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 1iW08c-0006Fo-CJ for pgsql-general@arkaria.postgresql.org; Sat, 16 Nov 2019 15:37:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iW08b-0006Xm-48 for pgsql-general@arkaria.postgresql.org; Sat, 16 Nov 2019 15:37:25 +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 1iW08a-0006Xf-NQ for pgsql-general@lists.postgresql.org; Sat, 16 Nov 2019 15:37:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iW08Y-0002k7-BQ for pgsql-general@postgresql.org; Sat, 16 Nov 2019 15:37:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xAGFbDlp029542; Sat, 16 Nov 2019 10:37:13 -0500 From: Tom Lane To: John Lumby cc: Adrian Klaver , pgsql general Subject: Re: access to original-statement predicates in an INSTEAD-OF row trigger In-reply-to: References: <8abf71b6-26b0-3d7e-f02c-9c33f323d792@aklaver.com> <6ea3b732-1f37-41c9-29a1-65f3aaebb6cd@aklaver.com> Comments: In-reply-to John Lumby message dated "Sat, 16 Nov 2019 14:52:19 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29540.1573918633.1@sss.pgh.pa.us> Date: Sat, 16 Nov 2019 10:37:13 -0500 Message-ID: <29541.1573918633@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk John Lumby writes: > How can a row trigger access the original SQL statement at the root of > the current operation? It can't; at least not in any way that'd be reliable or maintainable. I concur with the upthread recommendation that switching to serializable mode would be a more manageable way of dealing with concurrent-update problems. regards, tom lane