Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYG3C-00A3N6-Ca for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Jul 2024 02:23:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sYG3A-00E971-Fk for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Jul 2024 02:23:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYG3A-00E96t-7B for pgsql-bugs@lists.postgresql.org; Mon, 29 Jul 2024 02:23:48 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sYG37-001zgt-UY for pgsql-bugs@lists.postgresql.org; Mon, 29 Jul 2024 02:23:47 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 46T2Nhhi2455741; Sun, 28 Jul 2024 22:23:43 -0400 From: Tom Lane To: Peter Smith cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18558: ALTER PUBLICATION fails with unhelpful error on attempt to use system column In-reply-to: References: <18558-411bc81b03592125@postgresql.org> Comments: In-reply-to Peter Smith message dated "Mon, 29 Jul 2024 11:53:51 +1000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2455739.1722219823.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Sun, 28 Jul 2024 22:23:43 -0400 Message-ID: <2455740.1722219823@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Smith writes: > On Sat, Jul 27, 2024 at 11:15 PM PG Bug reporting form > wrote: >> The following script: >> CREATE TABLE t(a int); >> CREATE PUBLICATION p FOR TABLE t(a); >> >> ALTER PUBLICATION p SET TABLE t (a, ctid); >> triggers >> ERROR: negative bitmapset member not allowed > My fix: > I feel the ALTER ... SET and CREATE PUBLICATION the same column list > validation logic. But instead of cut/pasting that validation checking > from publication_translate_columns(), attached is a diff patch that > exposes the publication_translate_columns() so we can just call that > same function. Agreed on that, but shouldn't this patch also be removing some code from the ALTER ... SET path? Or is that part of the cleanup you handwaved about? > If this is deemed an acceptable fix, then I will improve on it (e.g. > IMO publication_translate_columns can modified to return the BMS), and > I will also add the necessary test cases. Have at it ... regards, tom lane