Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmS4I-0001Sw-OK for pgsql-odbc@arkaria.postgresql.org; Mon, 28 Aug 2017 21:59:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dmS4I-00029M-Al for pgsql-odbc@arkaria.postgresql.org; Mon, 28 Aug 2017 21:59:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dl9Je-00033I-59 for pgsql-odbc@postgresql.org; Fri, 25 Aug 2017 07:46:06 +0000 Received: from 89-212-252-137.static.t-2.net ([89.212.252.137] helo=neosys.si) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dl9JR-0005IA-A5 for pgsql-odbc@postgresql.org; Fri, 25 Aug 2017 07:46:05 +0000 Received: from Ex6.neosys.local (fdd2:1239:fdd7:1003:5152:1558:8971:ce3b) by Ex6.neosys.local (fdd2:1239:fdd7:1003:5152:1558:8971:ce3b) with Microsoft SMTP Server (TLS) id 15.1.225.42; Fri, 25 Aug 2017 09:45:51 +0200 Received: from Ex6.neosys.local ([fe80::5152:1558:8971:ce3b]) by Ex6.neosys.local ([fe80::5152:1558:8971:ce3b%13]) with mapi id 15.01.0225.041; Fri, 25 Aug 2017 09:45:51 +0200 From: =?iso-8859-2?Q?Matej_Miheli=E8?= To: "pgsql-odbc@postgresql.org" Subject: Q: Is there a way to force psqlODBC with enabled UseDeclareFetch to commit statements and avoid nesting transactions (savepoints)? Thread-Topic: Q: Is there a way to force psqlODBC with enabled UseDeclareFetch to commit statements and avoid nesting transactions (savepoints)? Thread-Index: AdMdcq0h1aQzvIbxRZep6bIxj3pQjw== Date: Fri, 25 Aug 2017 07:45:51 +0000 Message-ID: <2dc8921cc299459eb8bcc91bab1ae37b@neosys.si> Accept-Language: sl-SI, en-US Content-Language: sl-SI X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.33.54] x-gfi-smtp-submission: 1 x-gfi-smtp-hellodomain: Ex6.neosys.local x-gfi-smtp-remoteip: fdd2:1239:fdd7:1003:5152:1558:8971:ce3b x-pp-proceessed: 5dbf19b4-9f8c-49b9-904a-05e347d088e8 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org Q: Is there a way to force psqlODBC with enabled UseDeclareFetch to commit = statements and avoid nesting transactions (savepoints)? Since generated cursors are declared WITH HOLD they would survive COMMIT, a= nd I assume, release resources on the server. I know that this would not be= appropriate for all statements!=20 I am trying to determine if there is a combination of statement attributes = or some other settings that would make the ODBC driver operate in such fash= ion. I was hoping there is some combination of (statement) settings that wo= uld tell the driver that we are sending a forward only, read only, statemen= t. My hope is that this would allow the driver to avoid keeping the transac= tion open and prevent the application from staying "idle in transaction" un= til all cursors are fetched completely. What I'd like to achieve is an equivalent of the following "psql" script: BEGIN; declare cur1 NO SCROLL CURSOR WITH HOLD FOR SELECT * FROM pg_type; FETCH FORWARD 5 FROM cur1; COMMIT; BEGIN; declare cur2 NO SCROLL CURSOR WITH HOLD FOR SELECT * FROM pg_roles; FETCH FORWARD 5 FROM cur2; COMMIT; FETCH FORWARD 5 FROM cur1; FETCH FORWARD 5 FROM cur2; close cur1; close cur2; Perhaps my assumption, as I am coming from a different DB environment, that= releasing transactions in such cases would free significant resources, is = not really worth the effort on PostgreSQL. The other issue that I am thinki= ng of is the fact that these sessions will be terminated on "idle_in_transa= ction_session_timeout" and rollback the outer transaction and all consequen= tly, all nested savepoints.=20 I would really appreciate a comment from someone more knowledgeable about t= hese two assumptions. I am still in my initial strides with PG. -- Regards, Matej. --=20 Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc