Re: Fix publisher-side sequence permission reporting

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Tristan Partin <tristan(at)partin(dot)io>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix publisher-side sequence permission reporting
Date: 2026-06-20 12:43:59
Message-ID: CAHGQGwEA6PMAE0aMx4MFqj9d+q2Q835gfUyTSJjAkoMwtWB77A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jun 20, 2026 at 7:21 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Sat, Jun 20, 2026 at 2:54 PM Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> >
> > >
> > > Looks great! Thanks for fixing this.
> >
> > Thanks for the review! I've pushed the patches.
> >
>
> You seem to have forgotten to update the following comment in
> pg_get_sequence_data(): "Return all NULLs for missing sequences,
> sequences for which we lack
> privileges, other sessions' temporary sequences, ...".

Do you mean that the documentation for pg_get_sequence_data() should
also mention other sessions' temporary sequences and unlogged sequences
on standbys, as the comment does? If I've misunderstood your point,
could you clarify?

> BTW, if we go
> by the logic of your proposal, shouldn't one also distinguish other
> cases as mentioned in the comment quoted by me?

Do you mean that sequencesync.c should also distinguish other
sessions' temporary sequences and unlogged sequences on standbys, and
report separate warnings for those cases?

> Also, we might want to consider additional errhint as follows:

Sounds good.

> errhint("Grant UPDATE on the sequence to the subscription/sequence
> owner on the subscriber.")

Wouldn't it be better to drop "sequence" from "subscription/sequence
owner"? The sequence owner should already have UPDATE privilege on
the sequence. How about:

errhint("Grant UPDATE on the sequence to the subscription owner on
the subscriber.")

> errhint("Grant SELECT on the sequence to the replication role on the
> publisher.")

How about making this a bit more precise?

errhint("Grant SELECT on the sequence to the role used for the
replication connection on the publisher.")

Regards,

--
Fujii Masao

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-06-20 13:16:04 Re: PG20 Minimum Dependency Thread
Previous Message Fujii Masao 2026-06-20 11:54:03 Re: enhance wraparound warnings