Remove redundant privilege check from pg_sequences system view.
authorNathan Bossart <nathan@postgresql.org>
Mon, 1 Jul 2024 16:47:40 +0000 (11:47 -0500)
committerNathan Bossart <nathan@postgresql.org>
Mon, 1 Jul 2024 16:47:40 +0000 (11:47 -0500)
commit7967d10c5b49ccb82f67a0b80678a1a932bccdee
tree3707d09709af9ec96cacd80e6707ae3da0443d56
parent1afe31f03cd268a0bbb7a340d56b8eef6419bcb0
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
src/backend/catalog/system_views.sql
src/backend/commands/sequence.c
src/include/catalog/catversion.h
src/test/regress/expected/rules.out