Re: Column names in rowsets returned from function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Column names in rowsets returned from function
Дата
Msg-id 22896.1253985300@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Column names in rowsets returned from function  (Krzysztof Barlik <kbarlik@wp.pl>)
Ответы Re: Column names in rowsets returned from function  (Krzysztof Barlik <kbarlik@wp.pl>)
Список 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 по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: Solaris Postgres
Следующее
От: Zdenek Kotala
Дата:
Сообщение: Re: Solaris Postgres