Re: Behavior of identity columns

Поиск
Список
Период
Сортировка
От Francisco Olarte
Тема Re: Behavior of identity columns
Дата
Msg-id CA+bJJbyiMovsrqZmouLMSbFviVkteJdMTEGnRCwZ_w2Gk1icEg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Behavior of identity columns  ("sivapostgres@yahoo.com" <sivapostgres@yahoo.com>)
Список pgsql-general
On Thu, 4 Aug 2022 at 10:52, sivapostgres@yahoo.com
<sivapostgres@yahoo.com> wrote:
> I see 'identity' column values increment even when some error(s) occurs while inserting data.  Is that a known bug or
knownbehavior?
 

Known behaviour, explained thousand of times over the years.  Identity
is not a way to generate consecutive values, not ever guaranteed
ascending values, it is for generating unique values. The
implementation burn the values before commit/rollback for better
concurreency, search archives or docs for details. In your example, id
is allocated and burnt to generate the complete failing row, when it
fails it is gone. Search lists, google, the docs, its been explained
ad nauseam.

Francisco Olarte.



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

Предыдущее
От: Ron
Дата:
Сообщение: Re: How to choose new master from slaves.?
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Index only scans for expressional indices when querying for the expression