Обсуждение: using pl/pgsql

Поиск
Список
Период
Сортировка

using pl/pgsql

От
Antoine
Дата:
Hello all I would like to create a pl/pgsql function that can handle a
query that will work on different schemas.  But I am not sure about the
RECORD type and if I can return more then one row.   could PL/pgsql
return more then 1 row from the database.    Would i have to use the
FOR-IN-SELECT for this?
thanks if you can help
--
Antoine <asolomon15@nyc.rr.com>


Re: using pl/pgsql

От
Josh Berkus
Дата:
Antoine,

> Hello all I would like to create a pl/pgsql function that can handle a
> query that will work on different schemas.

Shouldn't be a problem if the function is set to run as the superuser.

> But I am not sure about the
> RECORD type and if I can return more then one row.   could PL/pgsql
> return more then 1 row from the database.

Starting with version 7.3.x, yes.  See:
http://techdocs.postgresql.org/guides/SetReturningFunctions

--
Josh Berkus
Aglio Database Solutions
San Francisco