Re: functions returning records

From: Alex Pilosov <alex(at)pilosoft(dot)com>
To: Reinoud van Leeuwen <reinoud(at)xs4all(dot)nl>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: functions returning records
Date: 2001-06-27 02:09:39
Message-ID: Pine.BSO.4.10.10106262207190.7004-100000@spider.pilosoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Mercer 2001-06-27 02:16:00 Re: Re: Encrypting pg_shadow passwords
Previous Message Dmitry G. Mastrukov 2001-06-27 01:48:36 Re: New data type: uniqueidentifier