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 1mxuyE-0006fm-Aj for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Dec 2021 17:55:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mxuyD-0008Bd-6p for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Dec 2021 17:55:09 +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 1mxuyC-0008BS-22 for pgsql-hackers@lists.postgresql.org; Thu, 16 Dec 2021 17:55:08 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxuy9-0006SO-8w for pgsql-hackers@postgresql.org; Thu, 16 Dec 2021 17:55:07 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 157845C0350; Thu, 16 Dec 2021 12:55:03 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 16 Dec 2021 12:55:03 -0500 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= fm1; bh=VDUvozH36iWjlV0Tr4VtKEHLCM0Uetg1TRR3sYlXU/U=; b=CBsElWgk FDisRqcRxSHb/6BBbzWOMP5Z5TTlgioHIKh7Xaxo2J2WDKdOPJIpjxeiMdsX++J8 EVNPV/m4Rh84wES9WC0oCHZLbf6l4HPCvvGxFVLxtQfEiBkr1weestUEhYvFXxpC txVJogS46inM8dIW2r2BHtn0SYfEYH6zPX/80c/zrD9EhQ5s1ROkrlKVZAtRpHRW 6xJ6xRyu+2myCfR0rhLVuTcRwiz1DlHP8lIABl5oaKMbOWuxh3G+a0wYipu7YIxK 60WLGrO/b0g4swSDtsDAYIow7JLMOUvfjqf2QeNrXVCQpwjPxt8LmofQbWUvyNed 37CJU3CBC5acyQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrleeggddutdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedujeevjeffjeevuddutedvkeeiueeitddvieelfeekveej udefgeeuvdejhfeuleenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Dec 2021 12:55:02 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id AB66D2A07D0; Thu, 16 Dec 2021 14:54:59 -0300 (-03) Date: Thu, 16 Dec 2021 14:54:59 -0300 From: Alvaro Herrera To: "houzj.fnst@fujitsu.com" Cc: Rahila Syed , Amit Kapila , Tomas Vondra , Peter Smith , PostgreSQL-development Subject: Re: Column Filtering in Logical Replication Message-ID: <202112161754.qzxph4hrdbfb@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Dec-16, houzj.fnst@fujitsu.com wrote: > The patch ensures all columns of RT are in column list when CREATE/ALTER > publication, but it seems doesn't prevent user from changing the replica > identity or dropping the index used in replica identity. Do we also need to > check those cases ? Yes, we do. As it happens, I spent a couple of hours yesterday writing code for that, at least partially. I haven't yet checked what happens with cases like REPLICA NOTHING, or REPLICA INDEX and then dropping that index. My initial ideas were a bit wrong BTW: I thought we should check the combination of column lists in all publications (a bitwise-OR of column bitmaps, so to speak). But conceptually that's wrong: we need to check the column list of each publication individually instead. Otherwise, if you wanted to hide a column from some publication but that column was part of the replica identity, there'd be no way to identify the tuple in the replica. (Or, if the pgouput code disobeys the column list and sends the replica identity even if it's not in the column list, then you'd be potentially publishing data that you wanted to hide.) -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/