Re: [SQL] function return multiply rows

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: [SQL] function return multiply rows
Дата
Msg-id 3D948B07.5050205@joeconway.com
обсуждение исходный текст
Ответы Re: [SQL] function return multiply rows  (Alvaro Herrera <alvherre@atentus.com>)
Список pgsql-general
Jeroen Olthof wrote:
> What is going wrong here?
>
> An example of what I'm trying to do.
>
> vw_teams is a view but same problem when trying it on a single table
> CREATE FUNCTION test() RETURNS SETOF vw_teams AS 'select * from vw_teams;'
> LANGUAGE 'sql';
>
> SELECT test();
>
> results in
>
>    test
> -----------
>  137789256
>  137789256
> (2 rows)

The capability to return composite types (multi-column rows) is limited in <=
PostgreSQL 7.2.x. What you are seeing are pointers to the rows, not the rows
themselves.

Version 7.3, in beta testing now, will do what you are looking for. If you
can, please give it a try. See:
   http://developer.postgresql.org/docs/postgres/xfunc-tablefunctions.html
for more info and examples.

HTH,

Joe


В списке pgsql-general по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [JDBC] Prepared statement performance...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: query speed depends on lifetime of frozen db?