From 9a196d9e82fb20c0df038ce486f153bfea64e3ce Mon Sep 17 00:00:00 2001 From: Fujii Masao Date: Thu, 18 Jun 2026 21:46:27 +0900 Subject: [PATCH v1 2/2] doc: Clarify pg_get_sequence_data() privileges and NULL results The documentation for pg_get_sequence_data() did not match the function's behavior. It stated that either USAGE or SELECT privilege was sufficient, but the function returns sequence data only when the caller has SELECT privilege. The documentation also did not explain that the function returns a row containing all NULL values when sequence data cannot be returned, such as when the sequence does not exist or the caller lacks the required privilege. Update the documentation to reflect the actual behavior, including the required privilege and the result returned when sequence data is unavailable. --- doc/src/sgml/func/func-sequence.sgml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/func/func-sequence.sgml b/doc/src/sgml/func/func-sequence.sgml index 4a2a6dc9369..de266c36296 100644 --- a/doc/src/sgml/func/func-sequence.sgml +++ b/doc/src/sgml/func/func-sequence.sgml @@ -163,12 +163,13 @@ SELECT setval('myseq', 42, false); Next nextvalis_called indicates whether the sequence has been used. page_lsn is the LSN corresponding to the most recent WAL record that modified this sequence relation. + This function returns a row of NULL values if the sequence does not + exist or if the current user lacks privileges on it. This function is primarily intended for internal use by pg_dump and by logical replication to synchronize sequences. It requires - USAGE or SELECT privilege on the - sequence. + SELECT privilege on the sequence. -- 2.53.0