public inbox for [email protected]
help / color / mirror / Atom feedFrom: Istvan Soos <[email protected]>
To: [email protected]
Subject: How to cleanup transaction after statement_timeout aborts a query?
Date: Sun, 8 Sep 2024 12:56:33 +0200
Message-ID: <CALdQGgv_an=JdfkomND7sJcuAS1L5OmbFzhQa9qcW48syTXyKg@mail.gmail.com> (raw)
I'm one of the developers of the Dart-language Postgresql client
package. I am working on adding a feature that may set the
statement_timeout value before a session or a query as the client
requests it, however, I'm stuck with the following error:
setup:
CREATE TABLE t (id INT PRIMARY KEY);
INSERT INTO t (id) values (1);
client-1:
BEGIN;
SELECT * FROM t WHERE id=1 FOR UPDATE;
<client sleeps for a while>
client-2:
BEGIN;
SET statement_timeout TO 1000;
SELECT * FROM t WHERE id=1 FOR UPDATE;
<server sends error message with the timeout>
After that any query I send through client-2 will get me the following error:
Severity.error 25P02: current transaction is aborted, commands ignored
until end of transaction block
Not even ROLLBACK or COMMIT is working. It is the same for both simple
and extended query protocol. Does the client need to send a non-query
message to cleanup the transaction state? Or is this connection now
gone for good?
Thanks,
Istvan
view thread (2+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: How to cleanup transaction after statement_timeout aborts a query?
In-Reply-To: <CALdQGgv_an=JdfkomND7sJcuAS1L5OmbFzhQa9qcW48syTXyKg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox