Re: nextval() on serial using old, existing value on insert?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: nextval() on serial using old, existing value on insert?
Дата
Msg-id CAKFQuwaV9z4xUoxaqLx0_-7UjaafWX3O0=1Rsu4EDi87PTxUrQ@mail.gmail.com
обсуждение исходный текст
Ответ на nextval() on serial using old, existing value on insert?  (Wells Oliver <wells.oliver@gmail.com>)
Ответы Re: nextval() on serial using old, existing value on insert?  (Wells Oliver <wells.oliver@gmail.com>)
Список pgsql-admin

On Wednesday, May 10, 2023, Wells Oliver <wells.oliver@gmail.com> wrote:
I have a simple table with a given column defined like so:

 common_key    | integer |           | not null | nextval('alias.identity_common_key_seq'::regclass)  | plain


Very very very infrequently, on an INSERT where this column is not specified, this column will be assigned a value that already exists in the table, versus the next presumably unused value in the sequence. I cannot figure this out. Is there any reason why this might be the case?

Most likely someone inserted data without using the sequence and eventually the sequence catches up with that previously inserted data.

David J.
 

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

Предыдущее
От: Keith
Дата:
Сообщение: Re: nextval() on serial using old, existing value on insert?
Следующее
От: Wells Oliver
Дата:
Сообщение: Re: nextval() on serial using old, existing value on insert?