Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1snFc7-0028DT-7Y for pgsql-general@arkaria.postgresql.org; Sun, 08 Sep 2024 10:57:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1snFb8-00Cemn-1t for pgsql-general@arkaria.postgresql.org; Sun, 08 Sep 2024 10:56:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1snFb7-00Ceht-Hl for pgsql-general@lists.postgresql.org; Sun, 08 Sep 2024 10:56:49 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1snFb4-000856-Mn for pgsql-general@lists.postgresql.org; Sun, 08 Sep 2024 10:56:48 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-53658f30749so2291516e87.3 for ; Sun, 08 Sep 2024 03:56:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725793004; x=1726397804; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=1QyuZdXHUhiCKeH6aOLeRPj6D1ouXmrnAMb2akqr3DA=; b=aBadE5bC1M5s1mlq1tGbtr3FQ22H6zrTRCt6Z32uD5WO4Eqz54DtHxyzeE8curLauR +ztv/g97nAJVFtnNisjjOYve4kZK6ny5sht8JZsHJJwRxS2PUjYi7VpKTx3AFn34UA1Z THd6bhMYYPUlSzOtwDbFvoF2tfWDFLnl4d40pJ73aQX8sknVlV0BqeXJ+VCgyojazt/r mX6atc9p8TO4wwNdRLDOFhtppHYhUMc/9I5GYbvu9rRF9TdfO0hiZv1IlCwgkBudtWzW G/sYsNcNgyd3WiwVkO3CNBMNAkLt0vDm6nYhVhcbRJogL5dVNTK44hCG7bHv/MDelDLu unKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725793004; x=1726397804; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=1QyuZdXHUhiCKeH6aOLeRPj6D1ouXmrnAMb2akqr3DA=; b=UNrYCQBQd9/ihTyJkm4JFifWWX1n1BZWnZi5wHhJ8YGu7+LgnEuaWje96s+Fi9nWjJ W0gk+bC2zrxBPwefgUk4UvElgMDsggJKcDhbb+OJCcqCPPJylqh6Ss6Dvk/KrXOLM4jH EBsfdLJBIQFpJnAL8+lzSw6dFfgnoG4bqa3JXOVHVSCkYFhQblX/EvFXrU62kthiVqdg CF9WGMhFOP+C/bs7F5YPRi6R1rxOx4OksyWqfBilAU0ae3zKbANnLB/TJOZs3nvpKUBv YsjeoCU4mDsCN5Cd9fmCFA7WUB20rUKs2FoQZmD4VnqhqgmRbezGavJbHNpAsyA9aoUj sINg== X-Gm-Message-State: AOJu0YxdO0eQ79IKBP5iw0rU4GK1BZEzpuO9vPHOYWeOoqIzf5D1R9W1 Id6bvU5Q6S5eTrPXHuE7QNwBcEUr7HcTu7xMQERdYVhn+34rx7gS0umzIKkWWLaRI3s7raHOjsy IuMBdZMczO1lUDvamKWH8TWYv+GJqEnKR X-Google-Smtp-Source: AGHT+IEpy/QPcAISiTEGoGT2JVrDjQe1kwCjt1DfryCoMr3aQoy4hBIsaKc0yGny4ELBB9ih9lDe9WR5M/B88qWO4/A= X-Received: by 2002:a05:6512:b03:b0:536:55cc:9642 with SMTP id 2adb3069b0e04-536587b44d3mr5753985e87.26.1725793003963; Sun, 08 Sep 2024 03:56:43 -0700 (PDT) MIME-Version: 1.0 From: Istvan Soos Date: Sun, 8 Sep 2024 12:56:33 +0200 Message-ID: Subject: How to cleanup transaction after statement_timeout aborts a query? To: pgsql-general@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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-2: BEGIN; SET statement_timeout TO 1000; SELECT * FROM t WHERE id=1 FOR UPDATE; 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