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 1jYabl-0002AV-Ou for pgsql-general@arkaria.postgresql.org; Tue, 12 May 2020 19:30:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jYabk-0001P2-AR for pgsql-general@arkaria.postgresql.org; Tue, 12 May 2020 19:30:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYabi-0001N6-7v for pgsql-general@lists.postgresql.org; Tue, 12 May 2020 19:30:28 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYabe-0000px-Sr for pgsql-general@lists.postgresql.org; Tue, 12 May 2020 19:30:25 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 460274C0; Tue, 12 May 2020 15:30:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 12 May 2020 15:30:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=Y mY3nIwil9Cbk3KtE0AO65WBUgsWw3myQ9DJ8MgOFvA=; b=MVaBVVjt1C07Lvs2u DYyBI2CsfnGmIbhEW6tvNh7JLyW211/xSWLTHtIhb2AfotcOSJOUaG8n1HfIOj6q 0xsOANiWV5ToeI4mdb416ldi71BJNEXwbMrMv6w2GPr+d4Q8+hCuEZaitWB905HC osE9jdKfsAQFWHrViunvKJId2FRD6APijTBRaTcScRkhqJnD56bl4SkfHJfP1BtU 3r0bzEEq2VjJ3KSaL+s6L0IrssDKZDMfve+qwaFBf4QdG69VNtgS0Jxgg64JVnzz SLIaeVVf8hczUMHrz3cUdBFDi0pOL5aPhdT4kPsZQ0IRgrQA4yk10H41eDtHaih2 n/fwA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=YmY3nIwil9Cbk3KtE0AO65WBUgsWw3myQ9DJ8MgOF vA=; b=BHv/y7G5X1b/mKrfvziKDTmxxHvGAafd5kDqLi1VbPVIGrO0QVhdyWTYL AEVFx8NQW6yV5W62qREpXooQlic2QQPcQ0NFzjZBrJj3n+rmKuj/OtI7yAjboIUE HiOwbJ/HgreIi81Afr8u2P88N1Fk/Rmvr8Nls56x7HfF0TxI1sP3orR5cflxBeR+ Tj7yCMo/geGxxV1bIcdxfX+s9KysL28RhNDw9z8dYnJo2ebClc2o9+A8B6464Nhc U5gv3bhBdL1L7g93mYzQYRY7IQIKQg+Ej29iFmvBMJIJBJIX+8c5m8KYP27HSUv/ s+rmMGWMnwtU+H1TblwfowLTSpWKA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrledvgddufeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtke ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepveevfeevfe eugeffkeekhfegieeufffgteeujedvgffhueejjefhkeejleegtdegnecukfhppeejhedr udejvddrhedrvdefudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.3] (75-172-5-231.tukw.qwest.net [75.172.5.231]) by mail.messagingengine.com (Postfix) with ESMTPA id A985F3280065; Tue, 12 May 2020 15:30:18 -0400 (EDT) Subject: Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction To: Matthias Apitz , pgsql-general@lists.postgresql.org References: <20200512145352.GA32335@sh4-5.1blu.de> <23100.1589298880@sss.pgh.pa.us> <20200512191429.GB32335@sh4-5.1blu.de> From: Adrian Klaver Message-ID: <9dbc6477-f9a2-b62a-e011-0983fe150741@aklaver.com> Date: Tue, 12 May 2020 12:30:17 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200512191429.GB32335@sh4-5.1blu.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 5/12/20 12:14 PM, Matthias Apitz wrote: > > To answer also the question of Adrian Klaver: > > The database in question has ~400 tables and the ESQL/C application has > for each table its own ESQL/C source file. It would be possible but a > nightmare to share the code and it's better to discuss the problem based > on the ESQL/c log file or I have to write some small example code to > reproduce the problem. The line numbers are relative to those source > files (and it's a pitty that the name of the source file is not logged, > onle the line numbers). Yeah, but there is a one:one mapping of table:source file and you know the table, so you should be able to find the source at the line number. Or am I missing something? Also, from OP did: insert into swd_auftrag .. COMMIT? > > El día Dienstag, Mai 12, 2020 a las 11:54:40 -0400, Tom Lane escribió: > >> Matthias Apitz writes: >>> We're facing in our ESQL/C written application a situation where a >>> commit'ed INSERT into a table is rolled back. >> >> Kind of hard to believe ... is there any sign of distress in the >> postmaster log? > > No. Nothing which points to this. > >> >>> I have here the ESQL/C >>> logging of the problem: >> >>> ... >>> [1471] [12.05.2020 15:48:50:476]: ecpg_execute on line 1744: query: insert into swd_daten ( katkey , aktion , reserv , id , ansetzung , nettodaten ) values ( $1 , $2 , $3 , $4 , $5 , $6 ); with 6 parameter(s) on connection sisis >>> [1471] [12.05.2020 15:48:50:476]: ecpg_process_output on line 1744: OK: INSERT 0 1 >>> [1471] [12.05.2020 15:48:50:477]: ECPGtrans on line 6716: action "commit"; connection "sisis" >>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> >> It's striking that this log shows a server ack of the INSERT, but no server >> ack of the COMMIT. Maybe that's just an oversight in the ESQL/C logging >> logic, but I wonder what's actually getting to the server. You might try > > I looked into the source and the ECPGtrans ... is logged before its > execution in the source interfaces/ecpg/ecpglib/misc.c and after the > execution only an error condition would be logged. As there is only the > line of the COMMIT w/o anything else, it seems to be executed fine. > >> enabling log_statement = all so you can get a trace of what the server >> thinks is happening. > > I will do so, but would have to find a time window for this to not be > swamped by the logs. > > Thanks for your reply to both, Adiran and Tom. > > matthias > -- Adrian Klaver adrian.klaver@aklaver.com