returning parameters from function

From: Rikard Pavelic <rikard(dot)pavelic(at)zg(dot)htnet(dot)hr>
To: pgsql-general(at)postgresql(dot)org
Subject: returning parameters from function
Date: 2006-12-12 09:30:07
Message-ID: 457E769F.4030000@zg.htnet.hr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message surabhi.ahuja 2006-12-12 09:31:12 any api in libpq to get the number of connections
Previous Message Richard Huxton 2006-12-12 09:11:48 Re: Why DISTINCT ... DESC is slow?