Re: functions

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Andrei Popovici <andreipopovici(at)yahoo(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: functions
Date: 2002-08-26 17:22:13
Message-ID: 200208261022.13053.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


Andrei,

> I understand that the PG synonym of MS-SQL stored
> procedure is the 'function'. Am I right?
>
> If so, then is it possible to return a multi-field,
> multi-row set from a function (just the way a simple
> 'select' does in MS-SQL stored procs)?

There is an awkward way of doing this in Postgres 7.2.1, involving CURSORS.
In 7.3, which will be out in beta sometime soon, it will be possible to have
T-SQL-like row-returning Functions.

There is one other difference btw. Postgres Functions and MSSQL Procedures;
Postgres functions may be called within a query, and MSSQL procdedures may
not. On the other hand, MSSQL procedures may return multiple result sets,
and I don't think anyone is proposing this for Postgres.

--
-Josh Berkus
Aglio Database Solutions
San Francisco

In response to

  • functions at 2002-08-26 11:44:51 from Andrei Popovici

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Eft, Aaron 2002-08-26 19:30:24 Alter Table Serial
Previous Message Andrei Popovici 2002-08-26 11:44:51 functions