pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: George Neuner <gneuner2@comcast.net>
To: pgsql-general@postgresql.org
Subject: Re: status of CURSORs after DISCONNECT
Date: Thu, 28 Nov 2019 16:07:06 -0500
Message-ID: <2pb0ue5ao2d9jj2ldsdhse96rod9haluac@4ax.com> (raw)
References: <20191128062715.GA2642@c720-r342378>
	<31445.1574953130@sss.pgh.pa.us>

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






view thread (4+ messages)

Message-ID: <2pb0ue5ao2d9jj2ldsdhse96rod9haluac@4ax.com>
Permalink:  ../2pb0ue5ao2d9jj2ldsdhse96rod9haluac@4ax.com/
Also on:    postgresql.org/message-id/2pb0ue5ao2d9jj2ldsdhse96rod9haluac@4ax.com

 · 

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: gneuner2@comcast.net
  Subject: Re: status of CURSORs after DISCONNECT
  In-Reply-To: <2pb0ue5ao2d9jj2ldsdhse96rod9haluac@4ax.com>
  References: <20191128062715.GA2642@c720-r342378> <31445.1574953130@sss.pgh.pa.us> <2pb0ue5ao2d9jj2ldsdhse96rod9haluac@4ax.com>

* 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