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 1pmQ9A-0000Js-3R for pgsql-general@arkaria.postgresql.org; Wed, 12 Apr 2023 02:23:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pmQ98-0004hn-SQ for pgsql-general@arkaria.postgresql.org; Wed, 12 Apr 2023 02:23:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pmQ98-0004hb-IG for pgsql-general@lists.postgresql.org; Wed, 12 Apr 2023 02:23:42 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pmQ95-0002Zx-Pq for pgsql-general@lists.postgresql.org; Wed, 12 Apr 2023 02:23:41 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 33C2Nb8s751897; Tue, 11 Apr 2023 22:23:37 -0400 From: Tom Lane To: Siddharth Jain cc: pgsql-general@lists.postgresql.org Subject: Re: Transaction Rollback errors In-reply-to: References: Comments: In-reply-to Siddharth Jain message dated "Tue, 11 Apr 2023 16:31:25 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <751895.1681266217.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 11 Apr 2023 22:23:37 -0400 Message-ID: <751896.1681266217@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Siddharth Jain writes: > when my application (Node.js) receives a class 40 error: > Class 40 — Transaction Rollback > 40000 transaction_rollback > 40002 transaction_integrity_constraint_violation > 40001 serialization_failure > 40003 statement_completion_unknown > 40P01 deadlock_detectedthen does it mean PG has already rolled back the tx > and therefore I should not attempt to roll it back again? Thanks, No, treat these the same as any other error. regards, tom lane