Re: Column names in rowsets returned from function - Mailing list pgsql-general

From Tom Lane
Subject Re: Column names in rowsets returned from function
Date
Msg-id 22896.1253985300@sss.pgh.pa.us
Whole thread Raw
In response to Column names in rowsets returned from function  (Krzysztof Barlik <kbarlik@wp.pl>)
Responses Re: Column names in rowsets returned from function  (Krzysztof Barlik <kbarlik@wp.pl>)
List pgsql-general
Krzysztof Barlik <kbarlik@wp.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

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: Solaris Postgres
Next
From: Zdenek Kotala
Date:
Subject: Re: Solaris Postgres