pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matthias Apitz <guru@unixarea.de>
To: pgsql-general@lists.postgresql.org
Subject: Re: testing in ESQL/C if a CUSROR "foo" is open?
Date: Mon, 30 Dec 2019 08:04:35 +0100
Message-ID: <20191230070435.GA3350@c720-r342378> (raw)
In-Reply-To: <20191227055522.GA2995@c720-r342378>
References: <20191227055522.GA2995@c720-r342378>

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





view thread (2+ messages)

Message-ID: <20191230070435.GA3350@c720-r342378>
Permalink:  ../20191230070435.GA3350@c720-r342378/
Also on:    postgresql.org/message-id/20191230070435.GA3350@c720-r342378

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: guru@unixarea.de
  Subject: Re: testing in ESQL/C if a CUSROR "foo" is open?
  In-Reply-To: <20191230070435.GA3350@c720-r342378>
  References: <20191227055522.GA2995@c720-r342378> <20191230070435.GA3350@c720-r342378>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox