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 1oaZX8-0000D1-Bd for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Sep 2022 09:27:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oaZX7-00031X-7X for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Sep 2022 09:27:13 +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 1oaZX6-00031M-5Y for pgsql-hackers@lists.postgresql.org; Tue, 20 Sep 2022 09:27:12 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaZX3-0005Sn-Ck for pgsql-hackers@postgresql.org; Tue, 20 Sep 2022 09:27:11 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id E0BCF32009B9; Tue, 20 Sep 2022 05:27:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 20 Sep 2022 05:27:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1663666026; x=1663752426; bh=c l8uvf6h2bNo9QKngqXklR8nUdsrnRKS1WkX3HD5/3Y=; b=F6/7RLbE9uA9lPR2o zgjgy8LYbDxVTmzu/VycIaS3JgiHcGScvv9otTsb8IO23n9FNUWSx6TVwA/I30df seWcZmd5eNVWXBlOtSuqUxx2v5AghkU7k65DSPdwYjIoJAHfoubsTlCAJXFGE7Or RI79xB8h3N+NvwC20jl/Aa805BFitqhwiTX/hyaQGrK/ZmJEpkiNQLzNyQ0kTTcB vFc1wZhLO/6uDIUO+vnHmKgXhdOfVkIKrnetV91n+TX4rzt9THKBu10YRET6v4Xl PhmYlncBOWQaeSZ5OHdWNCrOhjj95F7lpcpq+y7z7bh6CslCF23yFAiiMLJe5dv6 uclqA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedvledgudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 20 Sep 2022 05:27:05 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 9C8E538F; Tue, 20 Sep 2022 11:27:03 +0200 (CEST) Date: Tue, 20 Sep 2022 11:27:03 +0200 From: Alvaro Herrera To: Amit Kapila Cc: "houzj.fnst@fujitsu.com" , vignesh C , Robert Haas , Tom Lane , pgsql-hackers , Peter Eisentraut Subject: Re: why can't a table be part of the same publication as its schema Message-ID: <20220920092703.rypusmjsw4ihw6ap@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 2022-Sep-20, Amit Kapila wrote: > On Mon, Sep 19, 2022 at 8:46 PM Alvaro Herrera wrote: > > This seems a pretty arbitrary restriction. It feels like you're adding > > this restriction precisely so that you don't have to write the code to > > reject the ALTER .. SET SCHEMA if an incompatible configuration is > > detected. But we already have such checks in several cases, so I don't > > see why this one does not seem a good idea. > > > I agree that we have such checks at other places as well and one > somewhat similar is in ATPrepChangePersistence(). > > ATPrepChangePersistence() > { > ... > ... > /* > * Check that the table is not part of any publication when changing to > * UNLOGGED, as UNLOGGED tables can't be published. > */ Right, I think this is a sensible approach. > However, another angle to look at it is that we try to avoid adding > restrictions in other DDL commands for defined publications. Well, it makes sense to avoid restrictions wherever possible. But here, the consequence is that you end up with a restriction in the publication definition that is not very sensible. Imagine if you said "you can't add schema S because it contains an unlogged table". It's absurd. Maybe this can be relaxed in a future release, but it's quite odd. > The intention was to be in sync with FOR ALL TABLES. I guess we can change both (FOR ALL TABLES and IN SCHEMA) later. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/