Re: Multiple return 'columns' from postgre pl/pgsql

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Multiple return 'columns' from postgre pl/pgsql
Дата
Msg-id 21485.1091996770@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Multiple return 'columns' from postgre pl/pgsql  (Steve Tucknott <steve@retsol.co.uk>)
Ответы Re: Multiple return 'columns' from postgre pl/pgsql  (Steve Tucknott <steve@retsol.co.uk>)
Список pgsql-novice
Steve Tucknott <steve@retsol.co.uk> writes:
> Is there a way of doing:
> RETURNS INTEGER, CHAR(5), VARCHAR(200),.....
> IE return multiple values from a PL/PGSQL function?

You have to return a rowtype value.

There's an example in the 8.0devel docs:
http://developer.postgresql.org/docs/postgres/plpgsql-porting.html#PLPGSQL-PORTING-EX3

The example is making use of an 8.0-only feature (explicit names for
parameters) but otherwise I believe it would work in 7.4.  Not sure
about pre-7.4.

BTW, the correct name of our software is PostgreSQL or informally
Postgres.  No one associated with the project has ever called it
"Postgre".  Pronounce it "post-gress" or "post-gress-cue-ell".

            regards, tom lane

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

Предыдущее
От: Steve Tucknott
Дата:
Сообщение: Multiple return 'columns' from postgre pl/pgsql
Следующее
От: Christian Emery
Дата:
Сообщение: The best way to insert rows into multiple tables?