Re: Skipping schema changes in publication

From: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Andrei Lepikhov <lepihov(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, YeXiu <1518981153(at)qq(dot)com>, Ian Lawrence Barwick <barwick(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Skipping schema changes in publication
Date: 2026-03-11 05:41:29
Message-ID: CABdArM7avCmv+QbtPwDnF9J7gPnOqECCVj74hEt+pfSEzcKKHw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 10, 2026 at 6:19 PM vignesh C <vignesh21(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-03-11 07:04:34 Re: ALTER TABLE: warn when actions do not recurse to partitions
Previous Message shveta malik 2026-03-11 04:59:59 Re: Skipping schema changes in publication