Re: Prepared statements and cursors

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Prepared statements and cursors
Дата
Msg-id CAHyXU0wxJcf8p2=ipNmXcaN1LxupEma0Dt0D=xuWZyGDyRd8Sg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Prepared statements and cursors  (Andreas Lubensky <lubensky@cognitec.com>)
Список pgsql-general
On Tue, Jan 28, 2014 at 7:53 AM, Andreas Lubensky <lubensky@cognitec.com> wrote:
> That is an interesting approach. However, I see the problem that the
> functions would have to be removed when no longer needed. If that fails
> (broken connection etc.), they would be orphaned.
> Prepared statements are bound to the connection, so when the connection
> is closed they are gone.

well, you could abstract the function:
create or replace function eval(text) returns void as $$ begin execute
$1; end; $$ language plpgsql;
select eval('declare v cursor for select 0');

note, here eval() is a gaping security hole, so be advised.

merlin


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

Предыдущее
От: Andreas Lubensky
Дата:
Сообщение: Re: Prepared statements and cursors
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: PostgreSQL 9.2.4 using large amount of memory