create table foo(a int, b int); postgres=# create function rfoo() returns setof foo as $$ begin return query select foo from foo; end; $$ language plpgsql; CREATE FUNCTION Time: 25.606 ms postgres=# postgres=# postgres=# select rfoo(); ERROR: structure of query does not match function result type DETAIL: Number of returned columns (1) does not match expected column count (2).
Any reason why the above shouldn't work? Why does 'return query' assume that returned composite types are expanded? merlin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers