Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iaR0X-00084U-PR for pgsql-general@arkaria.postgresql.org; Thu, 28 Nov 2019 21:07:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iaR0W-0006dw-D9 for pgsql-general@arkaria.postgresql.org; Thu, 28 Nov 2019 21:07:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iaR0V-0006dm-W8 for pgsql-general@lists.postgresql.org; Thu, 28 Nov 2019 21:07:24 +0000 Received: from 195-159-176-226.customer.powertech.no ([195.159.176.226] helo=blaine.gmane.org) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iaR0P-0003vD-7g for pgsql-general@postgresql.org; Thu, 28 Nov 2019 21:07:22 +0000 Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1iaR0M-000MXI-7f for pgsql-general@postgresql.org; Thu, 28 Nov 2019 22:07:14 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-general@postgresql.org From: George Neuner Subject: Re: status of CURSORs after DISCONNECT Date: Thu, 28 Nov 2019 16:07:06 -0500 Message-ID: <2pb0ue5ao2d9jj2ldsdhse96rod9haluac@4ax.com> References: <20191128062715.GA2642@c720-r342378> <31445.1574953130@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: ForteAgent/8.00.32.1272 X-Antivirus: Avast (VPS 191127-0, 11/27/2019), Outbound message X-Antivirus-Status: Clean List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 28 Nov 2019 09:58:50 -0500, Tom Lane wrote: >Matthias Apitz 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