returning parameters from function - Mailing list pgsql-general

From Rikard Pavelic
Subject returning parameters from function
Date
Msg-id 457E769F.4030000@zg.htnet.hr
Whole thread Raw
Responses Re: returning parameters from function  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Hi!

Is there any plan to add implicit declaration of returning parameters
for functions?
Something like:
create function list(in a int) returns setof implicit record as
$$
if a=1 then select * from table1;
else select * from table2;
end if;
$$
languge sql;

which would than dynamically create output parameters depending on
selected query inside.

I think this would be very helpful, and is one of the
most missing features from MSSQL for me.

One other feature that I miss, but no so much is:
storing the entire function, not just the body
(because of this pg cant remember exactly how I wrote the
function, and if there are many parameters inside I get a looong first line)


Regards,
Rikard

pgsql-general by date:

Previous
From: "surabhi.ahuja"
Date:
Subject: any api in libpq to get the number of connections
Next
From: Richard Huxton
Date:
Subject: Re: Restore database from files (not dump files)?