使用日期时间参数在 pgadmin 中执行存储过程
execute stored procedures in pgadmin with datetime parameters
我是 pgadmin-4 和 postgressql 的新手,我不知道如何使用日期时间参数在 pgadmin 中执行存储过程?
CREATE OR REPLACE FUNCTION Check(a integer, b integer, startdate timestamp without time zone, enddate timestamp without time zone)
如何执行。
我已经 运行:
SELECT "Check"(56, 0,'2018-07-07','2018-07-09');
但它给我这样的错误:
函数检查(整数,整数,未知,未知)不存在
您可以检查两件事:
-- quoted function's name: "Check"
CREATE OR REPLACE FUNCTION "Check"(a integer, b integer,
startdate timestamp without time zone,
enddate timestamp without time zone)
并使用显式转换:
-- should work as-is
SELECT "Check"(56, 0,'2018-07-07','2018-07-09');
--with explicit cast
SELECT "Check"(56, 0,'2018-07-07'::timestamp without time zone,
'2018-07-09'::timestamp without time zone);
我是 pgadmin-4 和 postgressql 的新手,我不知道如何使用日期时间参数在 pgadmin 中执行存储过程?
CREATE OR REPLACE FUNCTION Check(a integer, b integer, startdate timestamp without time zone, enddate timestamp without time zone)
如何执行。 我已经 运行:
SELECT "Check"(56, 0,'2018-07-07','2018-07-09');
但它给我这样的错误:
函数检查(整数,整数,未知,未知)不存在
您可以检查两件事:
-- quoted function's name: "Check"
CREATE OR REPLACE FUNCTION "Check"(a integer, b integer,
startdate timestamp without time zone,
enddate timestamp without time zone)
并使用显式转换:
-- should work as-is
SELECT "Check"(56, 0,'2018-07-07','2018-07-09');
--with explicit cast
SELECT "Check"(56, 0,'2018-07-07'::timestamp without time zone,
'2018-07-09'::timestamp without time zone);