【发布时间】:2021-05-29 10:29:21
【问题描述】:
这个函数被创建为
CREATE OR REPLACE FUNCTION myschema._add1( vjson json, vtype smallint, vdate date)
returns void language 'plpgsql' cost 100 volatile security definer set search_path=myschema
as $$
begin
insert into myschema.tbl(cjson, ctype, cdate)
values(vjson, vtype, vdate);
end;
$$
Tbl 定义:
create table myschema.tbl(cjson json, ctype smallint, cdate date)
运行函数
select myschema._add1('{"j":["j1", "j2"]}', 1, '2021-02-26')获取
错误:函数 myschema._add1hidoc(unknown, integer, unknown) 没有 存在提示:没有函数匹配给定的名称和参数类型。 您可能需要添加显式类型转换。
select myschema._add1('{"j":["j1", "j2"]}'::json, 1, '2021-02-26'::date)获取
错误:函数 myschema._add1hidoc(json, integer, date) 没有 存在提示:没有函数匹配给定的名称和参数类型。 您可能需要添加显式类型转换。
【问题讨论】:
标签: postgresql