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

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема Re: pg_get_sequence_data Shows Non-NULL last_value for Freshly Created Sequence
Дата
Msg-id aKX8Ko8p-ENR3Ieo@nathan
обсуждение исходный текст
Ответ на pg_get_sequence_data Shows Non-NULL last_value for Freshly Created Sequence  (vignesh C <vignesh21@gmail.com>)
Ответы Re: pg_get_sequence_data Shows Non-NULL last_value for Freshly Created Sequence
Re: pg_get_sequence_data Shows Non-NULL last_value for Freshly Created Sequence
Список pgsql-hackers
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. This seems inconsistent. I felt
> pg_get_sequence_data should also return NULL for last_value in this
> case to match the others.
> Attached patch has a fix for the same. Thoughts?

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.

-- 
nathan



В списке pgsql-hackers по дате отправления: