Re: testing in ESQL/C if a CUSROR "foo" is open?

Поиск
Список
Период
Сортировка
От Matthias Apitz
Тема Re: testing in ESQL/C if a CUSROR "foo" is open?
Дата
Msg-id 20191230070435.GA3350@c720-r342378
обсуждение исходный текст
Ответ на testing in ESQL/C if a CUSROR "foo" is open?  (Matthias Apitz <guru@unixarea.de>)
Список pgsql-general
El día viernes, diciembre 27, 2019 a las 06:55:22a. m. +0100, Matthias Apitz escribió:

> 
> Hello,
> 
> Is there any way (without looking up the name in table 'pg_cursors') to see if a
> cursor "foo" is still open?
> 

I found this hint about 'pg_cursors' in stackoverflow:

https://stackoverflow.com/questions/51146931/postgres-finding-an-open-cursor-and-closing-it

But did no see how to code this in ESQL/C, something like:

EXEC SQL IF EXISTS(SELECT * FROM pg_cursors WHERE name = :cur) THEN CLOSE :cur;

Which does not work. And, what concerns me as well is how expensive such
test is before closing any cursor.

    matthias

-- 
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: replace single char for string using regexp_replace
Следующее
От: "Daniel Verite"
Дата:
Сообщение: Re: replace single char for string using regexp_replace