Re: pg_get_sequence_data Shows Non-NULL last_value for Freshly Created Sequence - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: pg_get_sequence_data Shows Non-NULL last_value for Freshly Created Sequence
Date
Msg-id aKZi9SUOzpP0wGTB@paquier.xyz
Whole thread Raw
In response to Re: pg_get_sequence_data Shows Non-NULL last_value for Freshly Created Sequence  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Aug 20, 2025 at 01:01:52PM -0400, Tom Lane wrote:
> The proposed patch includes a change to pg_dump that I suppose is
> meant to compensate.  But I'm not 100% sure that it does so correctly.
> Anyway, given that it's supposed to provide low-level inspection of
> the sequence tuple, I think that it's best not to be too cute.

The patch goes against the original promise of pg_get_sequence_data()
to "blindly" report the contents of the sequence tuple, so as
decisions can be taken in the frontend and not enforced in the
backend, which is what this patch is trying to introduce.

Also, FWIW, the current behavior of the function also matters around
[1], as this makes it easier for my AM callbacks to report what they
want in the result of pg_get_sequence_data().

[1]: https://commitfest.postgresql.org/55/
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: Skipping schema changes in publication
Next
From: Michael Paquier
Date:
Subject: Re: Remove redundant assignment of a variable in function AlterPublicationTables