mirror of
https://github.com/postgres/postgres.git
synced 2025-12-19 17:02:53 +03:00
Expose sequence page LSN via pg_get_sequence_data.
This patch enhances the pg_get_sequence_data function to include the page-level LSN (Log Sequence Number) of the sequence. This additional metadata will be used by upcoming patches to support synchronization of sequences during logical replication. By exposing the LSN, we enable more accurate tracking of sequence changes, which is essential for maintaining consistency across replicated nodes. Author: vignesh C <vignesh21@gmail.com> Reviewed-by: shveta malik <shveta.malik@gmail.com> Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com> Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Discussion: https://www.postgresql.org/message-id/CAA4eK1LC+KJiAkSrpE_NwvNdidw9F2os7GERUeSxSKv71gXysQ@mail.gmail.com
This commit is contained in:
@@ -840,10 +840,10 @@ SELECT nextval('test_seq1');
|
||||
(1 row)
|
||||
|
||||
-- pg_get_sequence_data
|
||||
SELECT * FROM pg_get_sequence_data('test_seq1');
|
||||
last_value | is_called
|
||||
------------+-----------
|
||||
10 | t
|
||||
SELECT last_value, is_called, page_lsn <= pg_current_wal_lsn() as lsn FROM pg_get_sequence_data('test_seq1');
|
||||
last_value | is_called | lsn
|
||||
------------+-----------+-----
|
||||
10 | t | t
|
||||
(1 row)
|
||||
|
||||
DROP SEQUENCE test_seq1;
|
||||
|
||||
@@ -414,6 +414,6 @@ SELECT nextval('test_seq1');
|
||||
SELECT nextval('test_seq1');
|
||||
|
||||
-- pg_get_sequence_data
|
||||
SELECT * FROM pg_get_sequence_data('test_seq1');
|
||||
SELECT last_value, is_called, page_lsn <= pg_current_wal_lsn() as lsn FROM pg_get_sequence_data('test_seq1');
|
||||
|
||||
DROP SEQUENCE test_seq1;
|
||||
|
||||
Reference in New Issue
Block a user