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 1m3gFZ-0000Zy-56 for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Jul 2021 14:52:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m3gFY-00013v-3e for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Jul 2021 14:52:36 +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 1m3gFX-00013m-2d for pgsql-hackers@lists.postgresql.org; Wed, 14 Jul 2021 14:52:35 +0000 Received: from new2-smtp.messagingengine.com ([66.111.4.224]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3gFT-0002il-KZ for pgsql-hackers@lists.postgresql.org; Wed, 14 Jul 2021 14:52:34 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 27796580820; Wed, 14 Jul 2021 10:52:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 14 Jul 2021 10:52:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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= fm3; bh=DNQVMS3ioEcNQNyNMn+qdQO1PaTM4LOxqskUuTITRrQ=; b=XyMe/MJ+ 0eGjDjIm5g7ON65WA623ysjd6Ebg1/OzCz6fWkkbov7RS8Vy542dwxnMeQDQW/SC jti6ylmptGdSmBsL5tpeUi+9iX1XlOCM5xbthFCNE/HCSO/N3yIm93yUrYsj+rYa M8pLAKOYwjiCMaXjqKNM2+ARvy6DH+WJWUdQgWN5LIwVylDFsAvyCqwMJScrri9a 0GgNa7mZLszkJK0XQchYcfYN1HfpA9uf/1MBAFGqH3sT2I7kr/+G5rkos3u3IKbP 13ib43i8eWY+WpyMuybPGQy5Cyzv/UqRvYA1qSy1PTr8xWlFADieUaeM2OBjxkzI 7F23h9YIdp+08A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekgdejkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqne cuggftrfgrthhtvghrnhepudejveejffejveduudetvdekieeuiedtvdeileefkeevjedu feeguedvjefhueelnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgv rhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 14 Jul 2021 10:52:28 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 386272A038C; Wed, 14 Jul 2021 10:52:25 -0400 (-04) Date: Wed, 14 Jul 2021 10:52:25 -0400 From: Alvaro Herrera To: Tomas Vondra Cc: Dilip Kumar , Amit Kapila , Euler Taveira , Peter Smith , Rahila Syed , Peter Eisentraut , =?utf-8?B?w5ZuZGVyIEthbGFjxLE=?= , japin , Michael Paquier , David Steele , Craig Ringer , Tomas Vondra , Amit Langote , PostgreSQL Hackers Subject: Re: row filtering for logical replication Message-ID: <202107141452.edncq4ot5zkg@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7ee3ec83-3e60-ba69-3ee9-a190a4b7714e@enterprisedb.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Jul-14, Tomas Vondra wrote: > The way I'm thinking about this is that for INSERT and DELETE it's clear > which row version should be used (because there's just one). And for UPDATE > we could see that as DELETE + INSERT, and apply the same rule to each > action. > > On the other hand, I can imagine cases where it'd be useful to send the > UPDATE when the old row matches the condition and new row does not. In any case, it seems to me that the condition expression should be scanned to see which columns are used in Vars (pull_varattnos?), and verify if those columns are in the REPLICA IDENTITY; and if they are not, raise an error. Most of the time the REPLICA IDENTITY is going to be the primary key; but if the user wants to use other columns in the expression, we can HINT that they can set REPLICA IDENTITY FULL. -- Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/ It does it in a really, really complicated way why does it need to be complicated? Because it's MakeMaker.