0
我想创建一个Posgresql函数返回一个表:无法创建PG SQL函数
create or replace function my_func1(var1 integer, var2 integer[], var3 integer)
returns table(col1 integer, col2 integer, col3 timestamp)
as
begin
select .........
end;
language sql;
它说:
ERROR: syntax error at or near "begin"
我应该在哪里放置 “$ FUNC $”在函数的结尾:在'language plpgsql之前或之后;'? – Torito
@Torito:请参阅手册中的示例。 [这里](https://www.postgresql.org/docs/current/static/sql-createfunction.html#SQL-CREATEFUNCTION-EXAMPLES)和[here](https://www.postgresql.org/docs/current /static/xfunc-sql.html)和[这里](https://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#AEN65553) –
@a_horse_with_no_name,我不需要。 – Torito