Re: functions - Mailing list pgsql-novice

From Josh Berkus
Subject Re: functions
Date
Msg-id 200208261022.13053.josh@agliodbs.com
Whole thread Raw
In response to functions  (Andrei Popovici <andreipopovici@yahoo.com>)
Responses Re: functions  (Andrei Popovici <andreipopovici@yahoo.com>)
List 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


pgsql-novice by date:

Previous
From: Andrei Popovici
Date:
Subject: functions
Next
From: Andrei Popovici
Date:
Subject: Re: functions