Re: Skipping schema changes in publication - Mailing list pgsql-hackers

From Nisha Moond
Subject Re: Skipping schema changes in publication
Date
Msg-id CABdArM7avCmv+QbtPwDnF9J7gPnOqECCVj74hEt+pfSEzcKKHw@mail.gmail.com
Whole thread
In response to Re: Skipping schema changes in publication  (vignesh C <vignesh21@gmail.com>)
Responses Re: Skipping schema changes in publication
List pgsql-hackers
On Tue, Mar 10, 2026 at 6:19 PM vignesh C <vignesh21@gmail.com> wrote:
>
> Thanks for the comments, these are addressed in the v61 version patch attached.
>
Thanks for the patch, I have few comments:

1) publicationcmd.c: CheckAlterPublication()
After the recent change to use stmt->for_all_tables, the
"excepttables" parameter is no longer used in this function and can be
removed.
~~~

Couple of minor suggestions:
2)
+ if (stmt->for_all_tables && !superuser())
+   ereport(ERROR,
+       errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
+       errmsg("must be superuser to define FOR ALL TABLES publication"));
+

Since this check is in the context of ALTER PUBLICATION, should the
error message instead be:
"must be superuser to alter FOR ALL TABLES publication"

3) test comment in publication.sql:1015 -
  "-- fail - ADD/DROP EXCEPT table requires superuser privileges"
The test uses only SET, not ADD/DROP, so the comment could be updated to:

-- fail - modifying EXCEPT table list requires superuser privileges
(I’m also fine with any better alternative.)

--
Thanks,
Nisha



pgsql-hackers by date:

Previous
From: shveta malik
Date:
Subject: Re: Skipping schema changes in publication
Next
From: Chao Li
Date:
Subject: Re: ALTER TABLE: warn when actions do not recurse to partitions