| From: | Joao Rito <joaovictor(dot)rito(at)gmail(dot)com> |
|---|---|
| To: | shihao zhong <zhong950419(at)gmail(dot)com> |
| Cc: | pgsql-bugs(at)lists(dot)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(at)eisentraut(dot)org>, imchifan(at)163(dot)com |
| Subject: | Re: BUG #19703: information_schema.usage_privileges omits a sequence owner's implicit USAGE privilege |
| Date: | 2026-11-15 03:53:59 |
| Message-ID: | 20261115035400.23692-1-joaovictor.rito@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
Hi Shihao,
I tested v1 0001 and 0002 on current master (81b2179b492, built with cassert and tap tests). Both apply cleanly. On master, for a sequence with no explicit grants, has_sequence_privilege says the owner has USAGE but the view has no row for it. The same happens for the new owner after ALTER SEQUENCE ... OWNER TO. Sequences with an explicit GRANT already showed the owner row. A table owner shows up in table_privileges without any grant, so sequences were the odd one out. The reproducer from the report gives implicit_view_rows=0 on master.
With the patches, the owner row appears for a sequence with no grants (is_grantable YES), for one with an explicit GRANT, for one with GRANT ... WITH GRANT OPTION, and for the new owner after ALTER OWNER TO. A role with no privileges sees no rows, and a sequence where the owner revoked its own USAGE has no owner row. For three roles and five sequences the view and has_sequence_privilege agree (0 mismatches, 2 before the patch). The reproducer now gives implicit_view_rows=1 and explicit_view_rows=1. make check passes (243 tests). With 0001 reverted and 0002 kept, privileges fails because the first new query returns 0 rows instead of 1, so the test does catch the bug.
What I did not test: the isolation and tap suites, pgindent, the docs, other platforms (I ran one Linux build), upgrades from an existing cluster, and the back branches. I agree with Tom's vote against back-patching, so I checked only master.
Small suggestions: the commit message of 0001 could mention that catversion is bumped or not, since Tom noted that information_schema changes have usually come with one, and the patch does not include one. The test could also cover a sequence whose owner is not the current user, but I have no objection to the change as it is.
Regards,
Joao Rito
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Joao Rito | 2026-11-15 03:54:32 | Re: BUG #19625: SQL/JSON boolean DEFAULT expression silently replaced with 'false' |
| Previous Message | shihao zhong | 2026-11-15 03:51:12 | Re: BUG #19702: decode() accepts Base64 payload after terminal padding |