From ab82340a43bebe57a3db0e52bb74120b3bb53ae5 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 6 Feb 2017 15:17:27 -0500 Subject: Avoid permission failure in pg_sequences.last_value Before, reading pg_sequences.last_value would fail unless the user had appropriate sequence permissions, which would make the pg_sequences view cumbersome to use. Instead, return null instead of the real value when there are no permissions. From: Michael Paquier Reported-by: Shinoda, Noriyoshi --- doc/src/sgml/catalogs.sgml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'doc/src/sgml') diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 204b8cfd55e..787cc10bf85 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -9882,7 +9882,10 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx The last sequence value written to disk. If caching is used, this value can be greater than the last value handed out from the - sequence. Null if the sequence has not been read from yet. + sequence. Null if the sequence has not been read from yet. Also, if + the current user does not have USAGE + or SELECT privilege on the sequence, the value is + null. -- cgit v1.2.3