Rename pg_sequence_read_tuple() to pg_get_sequence_data()
Michael Paquier <michael@paquier.xyz>
Rename pg_sequence_read_tuple() to pg_get_sequence_data() This commit removes log_cnt from the tuple returned by the SQL function. This field is an internal counter that tracks when a WAL record should be generated for a sequence, and it is reset each time the sequence is restored or recovered. It is not necessary to rebuild the sequence DDL commands for pg_dump and pg_upgrade where this function is used. The field can still be queried with a scan of the "table" created under-the-hood for a sequence. Issue noticed while hacking on a feature that can rely on this new function rather than pg_sequence_last_value(), aimed at making sequence computation more easily pluggable. Bump catalog version. Reviewed-by: Nathan Bossart Discussion: https://postgr.es/m/Zsvka3r-y2ZoXAdH@paquier.xyz
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/sequence.c | modified | +8 −9 |
| src/bin/pg_dump/pg_dump.c | modified | +2 −2 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_proc.dat | modified | +4 −4 |
| src/test/regress/expected/sequence.out | modified | +5 −5 |
| src/test/regress/sql/sequence.sql | modified | +2 −2 |
Discussion
- Removing log_cnt from pg_sequence_read_tuple() 7 messages · 2024-08-26 → 2024-08-29