| From: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
|---|---|
| To: | vignesh C <vignesh21(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-07-24 08:53:16 |
| Message-ID: | CAHGQGwHHvoWDY4T4yiNBJ+NM1ECzKyOTL5hvpqYM-pMKi0Fi7A@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Fri, Jul 24, 2026 at 3:37 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> The attached patch fixes this by marking the sequence as found on the
> publisher before returning COPYSEQ_PUBLISHER_INSUFFICIENT_PERM. Since
> receiving a row from the publisher proves that the sequence exists
> there, it should not also be reported as missing.
Thanks for the patch!
It looks good to me, except for one minor comment:
+ * The publisher lacks the SELECT privilege required by
+ * pg_get_sequence_data(). Since we received a row for this sequence,
+ * mark it as found so it is not also reported as missing.
Even when we receive a row, we still classify the sequence as missing
if pg_get_sequence_data() returns NULLs and has_sequence_privilege()
returns true. So "received a row for this sequence" doesn't seem quite
accurate to me.
So, isn't it clearer to describe this in terms of has_sequence_privilege()
returning false rather than NULL? For example:
/*
* The publisher lacks the SELECT privilege required by
* pg_get_sequence_data(). Since has_sequence_privilege() returned
* false, not NULL, do not classify this sequence as missing on the
* publisher.
*/
Regards,
--
Fujii Masao
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ian Lawrence Barwick | 2026-07-24 09:12:42 | [PATCH] doc: clarify AS requirement when VALUES used in a FROM clause |
| Previous Message | Chao Li | 2026-07-24 08:38:12 | Re: Collect ALTER PUBLICATION commands for event triggers |