Re: Improve documentation of publication privilege checks

From: Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Improve documentation of publication privilege checks
Date: 2025-12-24 06:22:52
Message-ID: CANhcyEWxsGyi6L0he+9KO0adA7X2He8fhWHyyokwHmMsE_Pktg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 24 Dec 2025 at 06:23, David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
> On Tue, Dec 23, 2025 at 4:43 PM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>>
>> Hi Shlok/Chao-San.
>>
>> How about this alternative wording:
>>
>> <para>
>> To create a publication using any of <literal>FOR ALL TABLES</literal>,
>> <literal>FOR ALL SEQUENCES</literal>, or
>> <literal>FOR TABLES IN SCHEMA</literal>, the user must be a superuser.
>> To alter a publication using <literal>ADD TABLE</literal>, the user must
>> have ownership rights on the table. To alter a publication using
>> <literal>ADD TABLES IN SCHEMA</literal>, the user must be a superuser.
>> </para>
>>
>
> I initially preferred Chao Li's version but upon deeper consideration I've settled on this variant. The conjunctions in the other are nice, but I've come to like how create and alter are better separated here. And the choice to list "add table" first breaks up the string of superuser required commands when switching from creating to altering.
>
> Kinda feel we should start this with the individual table creation case though:
>
> To create a publication using FOR TABLE, the user must have ownership rights on all listed tables. To create a publication using any of ... the user must be a superuser. To alter ...
>
> The alter case likewise accepts multiple tables...
>
Thanks Chao-san, Peter and David for reviewing the patch. I also felt
the version shared by Peter is more appropriate. I have made the
suggested changes by David.

Thanks,
Shlok Kyal

Attachment Content-Type Size
v2-0001-Improve-documentation-of-publication-privilege-ch.patch application/octet-stream 1.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2025-12-24 06:28:21 Re: [bug fix] prepared transaction might be lost when max_prepared_transactions is zero on the subscriber
Previous Message Michael Paquier 2025-12-24 06:21:04 Re: correct a word