From d1ef8f5eb3af6ae488d362152c1d78675281c489 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期三, 24 八月 2022 18:03:09 +0800
Subject: [PATCH] fix 修复 postgresql 时间查询类型转换报错问题

---
 script/sql/update/postgres/update-4.2-4.3.sql |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/script/sql/update/postgres/update-4.2-4.3.sql b/script/sql/update/postgres/update-4.2-4.3.sql
index c800937..8efbbd0 100644
--- a/script/sql/update/postgres/update-4.2-4.3.sql
+++ b/script/sql/update/postgres/update-4.2-4.3.sql
@@ -7,3 +7,10 @@
 insert into sys_menu values('1050', '璐︽埛瑙i攣', '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;

--
Gitblit v1.9.3