Remove redundant privilege check from pg_sequences system view.
Nathan Bossart <nathan@postgresql.org>
Remove redundant privilege check from pg_sequences system view. This commit adjusts pg_sequence_last_value() to return NULL instead of ERROR-ing for sequences for which the current user lacks privileges. This allows us to remove the call to has_sequence_privilege() in the definition of the pg_sequences system view. Bumps catversion. Suggested-by: Michael Paquier Reviewed-by: Michael Paquier, Tom Lane Discussion: https://postgr.es/m/20240501005730.GA594666%40nathanxps13
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/system_views.sql | modified | +1 −5 |
| src/backend/commands/sequence.c | modified | +4 −8 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/test/regress/expected/rules.out | modified | +1 −4 |
Discussion
- pg_sequence_last_value() for unlogged sequences on standbys 19 messages · 2024-05-01 → 2024-07-01