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 1l4Ynv-0003Ue-J4 for pgsql-bugs@arkaria.postgresql.org; Wed, 27 Jan 2021 00:35:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l4Yns-0007Ad-L3 for pgsql-bugs@arkaria.postgresql.org; Wed, 27 Jan 2021 00:35:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l4Ynr-0007AT-OM for pgsql-bugs@lists.postgresql.org; Wed, 27 Jan 2021 00:35:24 +0000 Received: from [66.111.4.26] (helo=out2-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l4Ynn-0002VR-Fd for pgsql-bugs@lists.postgresql.org; Wed, 27 Jan 2021 00:35:22 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id D777E5C0085; Tue, 26 Jan 2021 19:35:07 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 26 Jan 2021 19:35:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=iG9IJj8V6Q1wIymYdPeE3R1ksXS4PNGIqdJEqAH+zDY=; b=AjkFS3N0 Ni8AmN01WOjqyeUvxkYG5kcDjXVyIiHP9GRQmazYGKY7NbaHA2KqQPsXbqspOs5G VmSu9gsCxjVIVqLr4ctwMhbmH/3H1jLTUKTSpXB2xtojweM+rFFqYCYO4NUGien5 Ks35qAthNAgxeJe6PV1taAPFe47RDmzXm4NtsmcbESXVIcq4YFm6PlwwYtkFPwG+ 1CQ5xDz19lWivcOuxKRyRBp734WNbRm67pYdtKbdrsJYbs/GFTJLnBkN8bNxLSo8 LC7FwMnyYjlc9Z9c9dWZUywbm3zCpfj9R6SIQpGQsQob8YjdWDJ90+26SiJTiPmr GZRwEEGhdDB9RA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejgddvhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggugfgjfgesthekre dttderudenucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgv segrlhhvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepgffhhefgtdeiud fgvdekhefggefgheejkeejhffhjeejfedtgfekudfgveejvddtnecuffhomhgrihhnpehp ohhsthhgrhdrvghsnecukfhppeduledtrdelhedrudelrddujeejnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhv hhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.177]) by mail.messagingengine.com (Postfix) with ESMTPA id 204E3240057; Tue, 26 Jan 2021 19:35:07 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id AC1672A0FAE; Tue, 26 Jan 2021 21:35:04 -0300 (-03) Date: Tue, 26 Jan 2021 21:35:04 -0300 From: Alvaro Herrera To: pg@pmenke.de, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16794: BEFORE UPDATE FOR EACH ROW triggers on partitioned tables can break tuple moving UPDATEs Message-ID: <20210127003504.GA17625@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210123214411.GA12320@alvherre.pgsql> User-Agent: Mutt/1.10.1 (2018-07-13) X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.26 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2021-Jan-23, Alvaro Herrera wrote: > On 2020-Dec-28, PG Bug reporting form wrote: > > > i was testing the PG13 enhancement that should allow BEFORE ROW triggers on > > partitioned tables, as long as they don't move the tuple to a different > > partition (original thread: > > https://postgr.es/m/20200227165158.GA2071@alvherre.pgsql). The actual > > restriction on "not to move the tuple to a different partition" seems to be > > a bit stronger though, as the trigger fails, even though not itself, but the > > overarching UPDATE command, did move the tuple. > > Hi Philipp, thanks for reporting this issue. Yeah, that should > definitely work. I'll have a look at this in a couple of days and try > my best to have a fix for the February minors. Looked at this today, and it's not nearly as easy to fix as I hoped. The misbehavior in corner cases seems weird enough that we should keep the restriction ... but the way the restriction is implemented currently is completely broken. -- Álvaro Herrera 39°49'30"S 73°17'W Si no sabes adonde vas, es muy probable que acabes en otra parte.