Re: pg_get_sequence_data Shows Non-NULL last_value for Freshly Created Sequence

2025-08-20 Thread Michael Paquier
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

Re: pg_get_sequence_data Shows Non-NULL last_value for Freshly Created Sequence

2025-08-20 Thread Tom Lane
Nathan Bossart writes: > This function returns the values in the sequence tuple, primarily for > pg_dump (see commit bd15b7d). IIUC your patch would break pg_dump on v18 > and newer versions. The proposed patch includes a change to pg_dump that I suppose is meant to compensate. But I'm not 100%

Re: pg_get_sequence_data Shows Non-NULL last_value for Freshly Created Sequence

2025-08-20 Thread Nathan Bossart
On Wed, Aug 20, 2025 at 11:47:38AM -0500, Nathan Bossart wrote: > This function returns the values in the sequence tuple, primarily for > pg_dump (see commit bd15b7d). IIUC your patch would break pg_dump on v18 > and newer versions. Concretely, after the following commands, the patch causes pg_du

Re: pg_get_sequence_data Shows Non-NULL last_value for Freshly Created Sequence

2025-08-20 Thread Nathan Bossart
On Wed, Aug 20, 2025 at 07:16:55PM +0530, vignesh C wrote: > pg_sequences and pg_sequence_last_value return NULL for last_value, > which aligns with the expectation that the sequence hasn't been used > yet. However, pg_get_sequence_data returns the start value (1) even > though is_called is false.