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 1mxDas-0003ny-Qv for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Dec 2021 19:36:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mxDaM-000613-8X for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Dec 2021 19:35:38 +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 1mxDaL-00060i-B6 for pgsql-hackers@lists.postgresql.org; Tue, 14 Dec 2021 19:35:37 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxDaG-0005KQ-9Y for pgsql-hackers@postgresql.org; Tue, 14 Dec 2021 19:35:37 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 6D9BD320102F; Tue, 14 Dec 2021 14:35:27 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 14 Dec 2021 14:35:27 -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=fcwACJknpqYJrxmRhK88SCmRo6cn0udQSVVddldrmnA=; b=DEualkDN G9PC3YeQMRILymzpRinty8KR/+YinLHozyKW0fMRgdpb9XCzwdKMlORlys65sfzi 8QUT3w9r16YVl7IxWy6XOLMaG/P3FqajLP18QQMFmOSM+wsea+ZWoVIZ4mYCQlbZ Sygl+U2lP4fDhNjUFazpx0ODjmiJIe0DUxFIJpVs5w0uYHgVDA1Iy8TSFqnTt2EX sQWVbNkYtaOmRq/evZ7AIRU+S5UkuQfCfw9MgJt+V3pt624sZGU8+2QWINrpS/Ey KE9Y2FB+BLVsVfKq7v86c+nQifGp0qxkzngG4yZ31nPnENVXOYrKEpA9KMIYSR5D bbHW9EfhC+K+kw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrledtgdduvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedujeevjeffjeevuddutedvkeeiueeitddvieelfeekveej udefgeeuvdejhfeuleenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Dec 2021 14:35:26 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 33EB92A0804; Tue, 14 Dec 2021 16:35:23 -0300 (-03) Date: Tue, 14 Dec 2021 16:35:23 -0300 From: Alvaro Herrera To: Tomas Vondra Cc: Rahila Syed , Amit Kapila , Peter Smith , PostgreSQL-development Subject: Re: Column Filtering in Logical Replication Message-ID: <202112141935.3j2lva3je7o6@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-14, Tomas Vondra wrote: > Yeah. I think it's not clear if this should behave more like an index or a > view. When an indexed column gets dropped we simply drop the index. But if > you drop a column referenced by a view, we fail with an error. I think we > should handle this more like a view, because publications are externally > visible objects too (while indexes are pretty much just an implementation > detail). I agree -- I think it's more like a view than like an index. (The original proposal was that if you dropped a column that was part of the column list of a relation in a publication, the entire relation is dropped from the view, but that doesn't seem very friendly behavior -- you break the replication stream immediately if you do that, and the only way to fix it is to send a fresh copy of the remaining subset of columns.) > But why would it be easier not to add new object type? We still need to > check there is no publication referencing the column - either you do that > automatically through a dependency, or you do that by custom code. Using a > dependency seems better to me, but I don't know what are the complications > you mentioned. The problem is that we need a way to represent the object "column of a table in a publication". I found myself adding a lot of additional code to support OBJECT_PUBLICATION_REL_COLUMN and that seemed like too much. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/