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

From: Wells Oliver <wells(dot)oliver(at)gmail(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: nextval() on serial using old, existing value on insert?
Date: 2023-05-11 04:18:10
Message-ID: CAOC+FBWAzy8MDbwE2XJGsi8eV=QCuSS8orgAEdyOLr37_Z4ByQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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?

--
Wells Oliver
wells(dot)oliver(at)gmail(dot)com <wellsoliver(at)gmail(dot)com>

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Keith 2023-05-11 04:54:09 Re: nextval() on serial using old, existing value on insert?
Previous Message James Fraley 2023-05-10 21:01:18 Re: Index recreation details with REINDEX TABLE CONCURRENTLY