在PostGresql的控制台查看相关动作运行后系统自动生成的源代码,Copy后到Query中执行.
相关步骤:1.先在"tmplate1"-->"网要模式"-->"public"-->"函数群"中生成"函数群"(不知道怎样称呼,姑且这样)相关代码:
CREATE OR REPLACE FUNCTION plpgsql_call_handler()
RETURNS language_handler AS
'$libdir/plpgsql','plpgsql_call_handler'
LANGUAGE 'c' VOLATILE;
REVOKE ALL ON FUNCTION plpgsql_call_handler() FROM public;
GRANT EXECUTE ON FUNCTION plpgsql_call_handler() TO postgres
步骤2:在程序语言中新增程序语言,相关代码如下:
CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'
HANDLER plpgsql_call_handler;
方法2
CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'
HANDLER plpgsql_call_handler
VALIDATOR plpgsql_validator;
查看是否安装语言 select * from pg_language;
原文链接:https://www.f2er.com/postgresql/197008.html