Re: Fix publisher-side sequence permission reporting
Fujii Masao <masao.fujii@gmail.com>
From: Fujii Masao <masao.fujii@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Tristan Partin <tristan@partin.io>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-06-20T12:43:59Z
Lists: pgsql-hackers
On Sat, Jun 20, 2026 at 7:21 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Sat, Jun 20, 2026 at 2:54 PM Fujii Masao <masao.fujii@gmail.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
Commits
-
Fix unlogged sequence corruption after standby promotion
- d2980067bc3b 15 (unreleased) landed
- 913d3b610ccd 16 (unreleased) landed
- a1ed6a9a031a 17 (unreleased) landed
- 627605713074 18 (unreleased) landed
- 22af34b98362 19 (unreleased) landed
- 8e684ce11dda master landed
-
doc: Clarify pg_get_sequence_data() privileges and NULL results
- 031904048aa2 19 (unreleased) landed
-
Fix misreporting of publisher sequence permissions during sync
- d4a657b0a4db 19 (unreleased) landed
-
Introduce pg_sequence_read_tuple().
- c8b06bb969bf 18.0 cited