Table as an argument of a PostgreSQL function
问题 I'm trying to pass a table as an argument in a PostgreSQL function, and I can't find the right keyword (what should be instead of table in my code) in the first line : CREATE FUNCTION test.fcttest(table) RETURNS SETOF test.out_table AS $$ INSERT INTO test.out_table /* obviously, the schema for this table is what it should be, an int column for A.id and a varchar(30) column for A.another_field */ SELECT A.id, A.another_field FROM $1 A; SELECT A.id, A.another_field FROM $1 A; $$ LANGUAGE SQL;