Postgresql 数据库存储过程插入查询,我需要打印提升通知输入值
CREATE OR REPLACE FUNCTION new(pk character varying, u character varying,ps character varying)
RETURNS SETOF record AS
$BODY$
BEGIN
RAISE NOTICE 'PK is %','--'pk;
RAISE NOTICE 'Username is %','--'u;
RAISE NOTICE 'Password is %','--'ps;
EXECUTE 'INSERT INTO table_sp("pk_id","username","password")VALUES ('''||pk||''' ,'''||u||''','''||ps||''')' ;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100
ROWS 1000;
ALTER FUNCTION new(character varying, character varying,character varying)
OWNER TO postgres;
用户手册输入:
select new('2','admin','admin');
我提供了手动输入select new('2','admin','admin')
,我需要使用引发通知在 PostgreSQL 控制台输入值中打印,例如(RAISE NOTICE 'PK is %','--'pk)