Re: status of CURSORs after DISCONNECT - Mailing list pgsql-general

From George Neuner
Subject Re: status of CURSORs after DISCONNECT
Date
Msg-id 2pb0ue5ao2d9jj2ldsdhse96rod9haluac@4ax.com
Whole thread Raw
In response to status of CURSORs after DISCONNECT  (Matthias Apitz <guru@unixarea.de>)
List pgsql-general
On Thu, 28 Nov 2019 09:58:50 -0500, Tom Lane <tgl@sss.pgh.pa.us>
wrote:

>Matthias Apitz <guru@unixarea.de> writes:
>> When an ESQL/C written process issues a
>> EXEC SQL DISCONNECT [connection];
>> do the opened CURSOR(s) still survive?
>
>No.  Cursors are purely session-local objects in Postgres.
>I'm a bit surprised to hear it might be different in Sybase.
>
>            regards, tom lane
>

Sybase has a different notion of "session" that permits multiple
connections, and certain per session objects such as temp tables can
(optionally) be shared among all connections to the same session.

I'm not sure whether cursors similarly can be shared. Sybase allows
cursors and temp tables to be statically declared in the schema DDL.
Declared cursors and temp tables do not need to be "created"
explicitly - if they do not already exist, they can be instantiated
simply by mention in a query.

I have never tried sharing a cursor (or even using a declared cursor).
Queries in Sybase are *connection* specific, so I would think it would
be an error for multiple queries to try to reference the same cursor
name simultaneously.  But I haven't worked with Sybase for some years
so I am not up to date on the current software.

George




pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Rows violating Foreign key constraint exists
Next
From: Antonio Silva
Date:
Subject: using replace function