public inbox for [email protected]  
help / color / mirror / Atom feed
From: Dmitry Igrishin <[email protected]>
To: Wei Shan <[email protected]>
Cc: [email protected]
Subject: Re: Questions on Cursors in PostgreSQL
Date: Tue, 27 Jun 2017 20:53:08 +0300
Message-ID: <CAAfz9KOYXULgqb-YChRYCY6c+i6V+MUE1xSoNzBiJhNO6KmaJg@mail.gmail.com> (raw)
In-Reply-To: <CAFe9ZTov6QotwvyAmd_ibyXi=KYQpvLNgcCCV-0ZaLeZUjaqPw@mail.gmail.com>
References: <CAFe9ZTov6QotwvyAmd_ibyXi=KYQpvLNgcCCV-0ZaLeZUjaqPw@mail.gmail.com>
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgsql-interfaces>

2017-06-27 20:07 GMT+03:00 Wei Shan <[email protected]>:

> Hi all,
>
> I have some questions on PostgreSQL cursors (not PL/pgSQL but the libpq
> implementation):
>
>
>    1. What happens when my cursor hit the end of the table? Does it close
>    automatically? I suppose if I declare it as a SCROLLABLE cursor, it should
>    not close at all.
>
> The lifetime of cursors created by the DECLARE ... SQL command longs until
the end of the session, or until it explicitly closed by either CLOSE ...
or DISCARD SQL commands.

>
>    1. If I have declared a cursor and the session got disconnected, can I
>    reattach back to the cursor if I know the cursor name? I believe this is
>    not possible but I'm not very sure.
>
> When session ends all cursors are deallocated automatically. You should
open the new cursor on reconnect.


view thread (3+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Questions on Cursors in PostgreSQL
  In-Reply-To: <CAAfz9KOYXULgqb-YChRYCY6c+i6V+MUE1xSoNzBiJhNO6KmaJg@mail.gmail.com>

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

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