diff options
author | Nathan Bossart | 2024-07-31 15:12:42 +0000 |
---|---|---|
committer | Nathan Bossart | 2024-07-31 15:12:42 +0000 |
commit | c8b06bb969bf26c01f10b835e59d0aff39b7f516 (patch) | |
tree | 1042c5639ec85ca305eb414c6e77efe55487150f /src/test/regress/expected/sequence.out | |
parent | 68e9629985981ce8f8f04b5a9f8b3781eacaafd6 (diff) |
Introduce pg_sequence_read_tuple().
This new function returns the data for the given sequence, i.e.,
the values within the sequence tuple. Since this function is a
substitute for SELECT from the sequence, the SELECT privilege is
required on the sequence in question. It returns all NULLs for
sequences for which we lack privileges, other sessions' temporary
sequences, and unlogged sequences on standbys.
This function is primarily intended for use by pg_dump in a
follow-up commit that will use it to optimize dumpSequenceData().
Like pg_sequence_last_value(), which is a support function for the
pg_sequences system view, pg_sequence_read_tuple() is left
undocumented.
Bumps catversion.
Reviewed-by: Michael Paquier, Tom Lane
Discussion: https://postgr.es/m/20240503025140.GA1227404%40nathanxps13
Diffstat (limited to 'src/test/regress/expected/sequence.out')
-rw-r--r-- | src/test/regress/expected/sequence.out | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/regress/expected/sequence.out b/src/test/regress/expected/sequence.out index 2b47b7796b1..e749c4574e3 100644 --- a/src/test/regress/expected/sequence.out +++ b/src/test/regress/expected/sequence.out @@ -839,4 +839,11 @@ SELECT nextval('test_seq1'); 3 (1 row) +-- pg_sequence_read_tuple +SELECT * FROM pg_sequence_read_tuple('test_seq1'); + last_value | log_cnt | is_called +------------+---------+----------- + 10 | 32 | t +(1 row) + DROP SEQUENCE test_seq1; |