Re: functions returning records

Поиск
Список
Период
Сортировка
От Alex Pilosov
Тема Re: functions returning records
Дата
Msg-id Pine.BSO.4.10.10106262207190.7004-100000@spider.pilosoft.com
обсуждение исходный текст
Ответ на Re: functions returning records  (reinoud@xs4all.nl (Reinoud van Leeuwen))
Список pgsql-hackers
On Tue, 26 Jun 2001, Reinoud van Leeuwen wrote:

> Coming from a Sybase environment I would love to have functions return
> a result set. A few things to think of:
> 1: will it be possible to return multiple result sets? (in Sybase any
> select statement that is not redirected to variables or a table goes
> to the client, so it is quite common to do multiple selects). Does the
> postgresql client library support this?
No, libpq protocol cannot support that. This is really a sybasism, as good
as it is, no other database supports anything like that.

> 2: will it be possible to put a single result set in a table.
> Something like "resultfunction (argument) INTO TABLENAME" or "INSERT
> INTO TABLENAME resultfunction(argument)

It will be, but syntax will be:
select * into tablename from resultfunction(arg)
insert into tablename select * from resultfunction(arg)

(I.E. resultfunction must be in the 'from' clause)

-alex



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

Предыдущее
От: "Dmitry G. Mastrukov"
Дата:
Сообщение: Re: New data type: uniqueidentifier
Следующее
От: Jim Mercer
Дата:
Сообщение: Re: Re: Encrypting pg_shadow passwords