Re: SETOF and language 'plpgsql'

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SETOF and language 'plpgsql'
Дата
Msg-id 3083.1004823761@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: SETOF and language 'plpgsql'  ("Eric Ridge" <ebr@tcdi.com>)
Список pgsql-general
"Eric Ridge" <ebr@tcdi.com> writes:
>> How do you return a "setof <datatype>" from a plpgsql function?

> After searching the archives I found a post by Jan Wieck that basically
> says, "You can't....not sure if we will be able to  do  it  for  7.2".
> Then Tom Lane replied, "...If you want to fix plpgsql so that it retains
> state and can produce multiple elements of a set over repeated calls,
> the same way that SQL functions do, then it could be done today."

I think you misread that ;-).  What I was saying was that there wasn't
(any longer) anything outside plpgsql that would prevent it from
returning sets.  There would be a nontrivial amount of work to do inside
plpgsql to make it happen; see Jan's followup
http://archives2.us.postgresql.org/pgsql-sql/2000-08/msg00258.php

> It's over a year later.  What's the status today?

About the same.

There is support in 7.2 for plpgsql functions to return references to
cursors. This is not by any means the same thing as a SETOF result,
but it can serve some of the same purposes.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: CREATE TYPE delimiter?
Следующее
От: "Oliver Elphick"
Дата:
Сообщение: Re: Off-Topic: Accounting question