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 1oWFpO-0008R0-85 for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Sep 2022 11:36: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 1oWFpN-0004Xk-3x for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Sep 2022 11:36:13 +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 1oWFpM-0004Xb-QA for pgsql-hackers@lists.postgresql.org; Thu, 08 Sep 2022 11:36:12 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oWFpJ-0003Ra-SR for pgsql-hackers@postgresql.org; Thu, 08 Sep 2022 11:36:12 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 4EE9D5C0118 for ; Thu, 8 Sep 2022 07:36:08 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 08 Sep 2022 07:36:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from: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=1662636968; x=1662723368; bh=24135VY2mID8iUtPZTfJtnfL6gqc QhURRrk8ma7RSMM=; b=Gjzsg1jVmaLs7KBpFyoH9E5pVDg5y3YJRuVFKXnmPNFo 6VkTOLD9xQRwIAnIjANbYtsRRASTSaMGh9c8nGwPDTsqqxe+jDvuL7kWeNZF4VuQ p+7nUEGyOTmM1C9oPBWvS3KSguM4EUfx8XM6e8QzbgLE4o1qBcTgPrvIcGeDcGHx x/+QSmmDoYchBtFS7dlqgYiJs4UqWlEHOFLawjVsGpVgKHXDzEQU5WNOA7NqQpTf ZtBNkhL4mCEghm/25kQt6vRaJ4FQnRaaSk4CbJD4aMz6dZukIw2ImZ3i66CFR1L3 krYmv/XiKo6wClYRks6SOmG5iK2drlYC1EPst72Jrg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedtvddggeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfhuffvtgfgsehtjeertd dtfeejnecuhfhrohhmpefrvghtvghrucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgv ihhsvghnthhrrghuthesvghnthgvrhhprhhishgvuggsrdgtohhmqeenucggtffrrghtth gvrhhnpeeijeeuveeghfeiteettdegtdevhfdvleduleevveegleevtdelueehteevffdt ueenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvg htvghrrdgvihhsvghnthhrrghuthesvghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Feedback-ID: i131946ab:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 8 Sep 2022 07:36:07 -0400 (EDT) Message-ID: <2729c9e2-9aac-8cda-f2f4-34f2bcc18f4e@enterprisedb.com> Date: Thu, 8 Sep 2022 13:36:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Content-Language: en-US From: Peter Eisentraut Subject: why can't a table be part of the same publication as its schema To: pgsql-hackers Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Apparently, you can't add a table to a publication if its schema is already part of the publication (and vice versa), e.g., =# alter publication p1 add table s1.t1; ERROR: 22023: cannot add relation "s1.t1" to publication DETAIL: Table's schema "s1" is already part of the publication or part of the specified schema list. Is there a reason for this? It looks a bit like a misfeature to me. It constrains how you can move your tables around between schemas, based on how somewhere else a publication has been constructed. It seems to me that it shouldn't be difficult to handle the case that a table is part of the publication via two different routes. (We must already handle that since a subscription can use more than one publication.)