From: | Wei Shan <weishan(dot)ang(at)gmail(dot)com> |
---|---|
To: | Dmitry Igrishin <dmitigr(at)gmail(dot)com> |
Cc: | pgsql-interfaces(at)postgresql(dot)org |
Subject: | Re: Questions on Cursors in PostgreSQL |
Date: | 2017-07-04 08:53:08 |
Message-ID: | CAFe9ZTo-wOVKjD0bgkEE=CS3N=qDpk60OE7VuLOng9-GmaMS1Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-interfaces |
Thanks a lot!
On 27 Jun 2017 18:53, "Dmitry Igrishin" <dmitigr(at)gmail(dot)com> wrote:
2017-06-27 20:07 GMT+03:00 Wei Shan <weishan(dot)ang(at)gmail(dot)com>:
> 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.
From | Date | Subject | |
---|---|---|---|
Next Message | Scott Beil | 2017-07-12 00:29:47 | Sporadic "relation does not exist" errors with psqlODBC |
Previous Message | Dmitry Igrishin | 2017-06-27 17:53:08 | Re: Questions on Cursors in PostgreSQL |