fix 修复 postgresql 时间查询类型转换报错问题

This commit is contained in:
疯狂的狮子li
2022-08-24 18:03:09 +08:00
parent 3950f3c869
commit d1ef8f5eb3
2 changed files with 13 additions and 0 deletions

View File

@ -7,3 +7,10 @@ update sys_config set config_key = 'sys.account.captchaEnabled' where config_id
insert into sys_menu values('1050', '账户解锁', '501', '4', '#', '', '', '1', '0', 'F', '0', '0', 'monitor:logininfor:unlock', '#', 'admin', now(), '', null, '');
insert into sys_role_menu values ('2', '1050');
-- 字符串自动转时间 避免框架时间查询报错问题
create or replace function cast_varchar_to_timestamp(varchar) returns timestamptz as $$
select to_timestamp($1, 'yyyy-mm-dd hh24:mi:ss');
$$ language sql strict ;
create cast (varchar as timestamptz) with function cast_varchar_to_timestamp as IMPLICIT;