Обсуждение: pgsql: Remove redundant privilege check from pg_sequences system view.

Поиск
Список
Период
Сортировка

pgsql: Remove redundant privilege check from pg_sequences system view.

От
Nathan Bossart
Дата:
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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7967d10c5b49ccb82f67a0b80678a1a932bccdee

Modified Files
--------------
src/backend/catalog/system_views.sql |  6 +-----
src/backend/commands/sequence.c      | 12 ++++--------
src/include/catalog/catversion.h     |  2 +-
src/test/regress/expected/rules.out  |  5 +----
4 files changed, 7 insertions(+), 18 deletions(-)