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 1imAUr-0002K4-F9 for pgsql-general@arkaria.postgresql.org; Tue, 31 Dec 2019 05:55:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1imAUn-0003yY-Jl for pgsql-general@arkaria.postgresql.org; Tue, 31 Dec 2019 05:55:09 +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 1imAUn-0003yR-4S for pgsql-general@lists.postgresql.org; Tue, 31 Dec 2019 05:55:09 +0000 Received: from ms-10.1blu.de ([178.254.4.101]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1imAUj-0001dm-Tr for pgsql-general@lists.postgresql.org; Tue, 31 Dec 2019 05:55:07 +0000 Received: from [188.174.59.27] (helo=localhost.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.86_2) (envelope-from ) id 1imAUh-0004sW-LT for pgsql-general@lists.postgresql.org; Tue, 31 Dec 2019 06:55:03 +0100 Received: from localhost.my.domain (localhost [127.0.0.1]) by localhost.unixarea.de (8.15.2/8.14.9) with ESMTPS id xBV5t2gh020180 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Tue, 31 Dec 2019 06:55:02 +0100 (CET) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.15.2/8.14.9/Submit) id xBV5t2cC020179 for pgsql-general@lists.postgresql.org; Tue, 31 Dec 2019 06:55:02 +0100 (CET) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Tue, 31 Dec 2019 06:55:01 +0100 From: Matthias Apitz To: pgsql-general@lists.postgresql.org Subject: How to reset a server error '25P02 in_failed_sql_transaction' Message-ID: <20191231055501.GA2812@c720-r342378> Reply-To: Matthias Apitz MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Operating-System: FreeBSD 13.0-CURRENT r342378 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. User-Agent: Mutt/1.11.1 (2018-12-01) X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 188.174.59.27 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, Due to a wrong human input in the GUI of our application our application server, from the point of view of the PostgreSQL server it is the PostgreSQL client, issues a broken ESQL/C command to the PostgreSQL server, here from our own debug logging the command and the error message of the server: posDebug: [27.12.2019 15:20:59:043] stmt: SELECT ctid, * from titel_datum WHERE desk>='*2019' AND feldnr IN ( 2 ) ORDER BY desk ASC , feldnr ASC posDebug: [27.12.2019 15:20:59:043] ESQL: PREPARE sid_titel_datum FROM :select_anw; ==== sqlca ==== sqlcode: -400 sqlerrm.sqlerrml: 61 sqlerrm.sqlerrmc: invalid input syntax for type date: »*2019« on line 918 ... All subsequent correct (SELECT ...) statements get rejected with, for example: ... posDebug: [27.12.2019 15:20:59:044] stmt: SELECT ctid, * from titel_datum WHERE desk>='31.12.1900' AND feldnr IN ( 2 ) ORDER BY desk ASC , feldnr ASC posDebug: [27.12.2019 15:20:59:044] ESQL: PREPARE sid_titel_datum FROM :select_anw; ==== sqlca ==== sqlcode: -400 sqlerrm.sqlerrml: 105 sqlerrm.sqlerrmc: current transaction is aborted, commands ignored until end of transaction block on line 918 sqlerrd: 0 0 0 0 0 0 sqlwarn: 0 0 0 0 0 0 0 0 sqlstate: 25P02 ========posSqlError======= ... Note: we are not in some kind TRANSACTION block, like 'EXEC SQL BEGIN TRANSACTION;' What is the correct way to abort the "transaction" as requested by the PG server to return to normal operations? Thanks matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub