Re: WITH HOLD ref cursors for plpgsql

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: WITH HOLD ref cursors for plpgsql
Дата
Msg-id 24040.1361350004@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: WITH HOLD ref cursors for plpgsql  (Daniel Wood <dwood@salesforce.com>)
Список pgsql-novice
Daniel Wood <dwood@salesforce.com> writes:
> So how does one create a "WITH HOLD ref cursor for plpgsql"?

You don't --- as the previous thread mentioned, there doesn't seem
to be a lot of use-case for that, and it goes against plpgsql's
model of cursors as essentially being local variables of functions.

If you're really feeling desperate to use plpgsql to create a cursor
that will be used later by some calling application, you could probably
do EXECUTE 'DECLARE c CURSOR WITH HOLD FOR SELECT ...'.  But it's not
immediately clear to me why that's better than letting the calling
application do the DECLARE for itself.

            regards, tom lane


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

Предыдущее
От: Sergey Konoplev
Дата:
Сообщение: Re: Return table and integer value
Следующее
От: Paul Smith
Дата:
Сообщение: minimum hardware requirements for small postgres db