Re: Column names in rowsets returned from function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Krzysztof Barlik <kbarlik(at)wp(dot)pl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Column names in rowsets returned from function
Date: 2009-09-26 17:15:00
Message-ID: 22896.1253985300@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Krzysztof Barlik <kbarlik(at)wp(dot)pl> writes:
> I have a question - is it possible to rename
> columns in rowset returned from plpgsql function
> delared as 'returns table(...)' ?

Sure ...

regression=# create function foo() returns table (a int, b text) as
regression-# $$ values (1,'one'), (2,'two') $$ language sql;
CREATE FUNCTION
regression=# select * from foo();
a | b
---+-----
1 | one
2 | two
(2 rows)

regression=# select * from foo() as x(y,z);
y | z
---+-----
1 | one
2 | two
(2 rows)

If that's not what you are talking about, you need to be more
specific about what you are talking about.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Zdenek Kotala 2009-09-26 17:34:13 Re: Solaris Postgres
Previous Message John R Pierce 2009-09-26 16:44:40 Re: Solaris Postgres