Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ouxrL-0003UT-LI for pgsql-general@arkaria.postgresql.org; Tue, 15 Nov 2022 15:28:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ouxrK-00031w-3s for pgsql-general@arkaria.postgresql.org; Tue, 15 Nov 2022 15:28:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ouxrJ-0002yr-PL for pgsql-general@lists.postgresql.org; Tue, 15 Nov 2022 15:28:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ouxrD-0007SL-2o for pgsql-general@postgresql.org; Tue, 15 Nov 2022 15:28:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 2AFFSBIf1070975; Tue, 15 Nov 2022 10:28:11 -0500 From: Tom Lane To: Adrian Klaver cc: Matthias Apitz , Postgres General Subject: Re: PostgreSQL server "idle in transaction" In-reply-to: References: <20221115122813.GA9@sh4-5.1blu.de> Comments: In-reply-to Adrian Klaver message dated "Tue, 15 Nov 2022 07:08:32 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1070973.1668526091.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 15 Nov 2022 10:28:11 -0500 Message-ID: <1070974.1668526091@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Adrian Klaver writes: > On 11/15/22 04:28, Matthias Apitz wrote: >> I have below the full ESQL/C log and do not understand, why the >> PostgreSQL server is thinking "idle in transaction". For me with the >> "COMMIT" on the line below marked with ^^^^^ the transaction was closed= . > From your log: > [6978] [15.11.2022 11:05:50:172]: ECPGtrans on line 1211: action = > "commit"; connection "testdb" > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^= ^^^^^^^^^^^^^^^^^^^^^^ > [6978] [15.11.2022 11:05:50:173]: ecpg_execute on line 543: query: = > select name from pg_cursors where name =3D $1 ; with 1 parameter(s) on = > connection testdb > So that query is being executed after the COMMIT. Right. By default, ecpg would start a new transaction block for that. See https://www.postgresql.org/docs/current/ecpg-commands.html#ECPG-TRANSACTIO= NS regards, tom lane