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 1snHYN-002NQb-Tj for pgsql-general@arkaria.postgresql.org; Sun, 08 Sep 2024 13:02:08 +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 1snHYN-00E2K5-Hp for pgsql-general@arkaria.postgresql.org; Sun, 08 Sep 2024 13:02:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1snHYN-00E2Jw-6c for pgsql-general@lists.postgresql.org; Sun, 08 Sep 2024 13:02:07 +0000 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1snHYJ-0008yo-6G for pgsql-general@lists.postgresql.org; Sun, 08 Sep 2024 13:02:06 +0000 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-5356ab89665so4105812e87.1 for ; Sun, 08 Sep 2024 06:02:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725800522; x=1726405322; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tCWEswusF5udnjoVyk7phIoJG0DtWSzLFsIYeB63PRY=; b=nBypSyRGLAR0Hd2N+/J5nMDd/H3Zfuy2/hZrP722H8JFiRxFngZ0ZWv7GKE+UQICvA j62PEGV8cxiKXnqJ4ipuAzpHc1HxPN5/XWAzhjytH3rdWiW75m/uLVBC6aYOmIxV3zqK h+rp3R9yTff1e00gB041XaRRRgR89ox2JG3HbaU5BxdRAPtXkfLubX3+sN2ZnQqDyBYN j0CkfhEA1MCtqFhn0gO8td4c59o0zuELNQcX3FbA8KDvz/74st/D8FfalrdoRVT7d11T kgyeZQTqnAfj3A7DoveWRK0zHcd8iVSq94uIaQ0b8taq2MZdlFH6NrZrbQDIBaSRXVZ0 mZTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725800522; x=1726405322; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tCWEswusF5udnjoVyk7phIoJG0DtWSzLFsIYeB63PRY=; b=EJkowsYkXBno6+5vnaNqh4Uy3LcjdXg5hFUICDcm2yhbDWQrEg1MBmN5hlGsY7QWz0 /NBpUUVHZTxcubub3rBSL95FigPuhoYpMBLl3rXSjdq/nnPHFzGHPx93vaQ6RtN8FoM3 29pg46UJg8m4iVO6sM5WILXbwniI4UE01MYTTTph+vLgTevFCgSBGHijKWDMOlxecAHa 1oHX4SAkBCKNGPbqXsPvCba084KQbC7vv37CAJZurZUzZ4bl2lTOpU45pQRkhRVfT3Od 9w3KG2dGQHM8j7XmRpHoYsLqWBHgYQ0Ys1+vkKRTLVCBzvG/UneMIB2RPBKYuw/MOcZS 01Ww== X-Gm-Message-State: AOJu0YxtYNuqeOK07EgDyHY7MwfyZZyzpEpxfHqpwRPV1oX7mRaJL63N Jc+ILQfR/0SjxYndR27AwoEKp6vcZStg7D9cIaH8COXkNPu6LME62d8eVpkYtWlw5y32ccuPvG+ +PBwfMXMpVJ9LAoW3ljU9gb6jB/VxnMLn X-Google-Smtp-Source: AGHT+IGhx2h1/mHupiEs50SKtXGu+99ImDPyMI5D+Oc4efUR6ayYDv4c/niphSInIuPfoRSa3wkMjTMxmZvbo8ejrAg= X-Received: by 2002:a05:6512:33cb:b0:52c:dc97:45d1 with SMTP id 2adb3069b0e04-536587aa70cmr4455553e87.10.1725800522124; Sun, 08 Sep 2024 06:02:02 -0700 (PDT) MIME-Version: 1.0 References: <8fabad5643b3b10355c95e30f4e758c17640d0d0.camel@cybertec.at> In-Reply-To: <8fabad5643b3b10355c95e30f4e758c17640d0d0.camel@cybertec.at> From: Istvan Soos Date: Sun, 8 Sep 2024 15:01:51 +0200 Message-ID: Subject: Re: How to cleanup transaction after statement_timeout aborts a query? To: Laurenz Albe Cc: pgsql-general@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Sep 8, 2024 at 1:19=E2=80=AFPM Laurenz Albe wrote: > ROLLBACK and COMMIT are working: they end the transaction. I have this reproduction test, and ROLLBACK does fail: https://github.com/isoos/postgresql-dart/pull/363/files#diff-4547e49b04ec82= 80fb8f4f1ebf695b77f9a2d9a4ac9bcfd685bcd570a46baa80R122 I've checked and nothing else is sent on the protocol, yet, for the rollback statement it gets the 25P02 error. > It is the atomicity guarantee of database transactions: either all statem= ents > succeed, or all fail. Yeah, I thought so, that's why I'm struggling to see what's missing. > To handle the failure of a statement while allowing the transaction to pr= oceed, > you can use savepoints. But be warned: don't even think of setting a sav= epoint > before each statement. That would affect statement performance severely. As the writer of the client library, I don't have the luxury of telling users they need to change their way, hence I'm looking for any pointer on the protocol level. Thanks, Istvan