我需要一个Postgres函数来返回一个带有自定义内容的虚拟表(就像在Oracle中一样).该表将有3列和未知行数.
我在互联网上找不到正确的语法.
想象一下:
CREATE OR REPLACE FUNCTION "public"."storeopeninghours_tostring" (numeric)
RETURNS setof record AS
DECLARE
open_id ALIAS FOR $1;
returnrecords setof record;
BEGIN
insert into returnrecords('1', '2', '3');
insert into returnrecords('3', '4', '5');
insert into returnrecords('3', '4', '5');
RETURN returnrecords;
END;
Run Code Online (Sandbox Code Playgroud)
这怎么写的正确?