Re: duplicate key violates unique on a nextval() field - Mailing list pgsql-general

From Peter Warasin
Subject Re: duplicate key violates unique on a nextval() field
Date
Msg-id 4E5D1DB9.8020704@endian.com
Whole thread Raw
In response to Re: duplicate key violates unique on a nextval() field  (Scott Ribe <scott_ribe@elevated-dev.com>)
Responses Re: duplicate key violates unique on a nextval() field
List pgsql-general
Hi

thank you for answering!

On 30/08/11 18:56, Scott Ribe wrote:
>> But how can that happen when it is bigserial?
>
> Postgres only assigns the value if it is not explicitly provided. Any client, freeradius included, could be assigning
idsand could have bugs. Allowing pg to assign the value is safe, using nextval is safe--I'd look for client code that
triesto get ranges ahead of time & cache... 

freeradius is not supplying an id.
that field is left away as it should be in order to use nextval

that renders the whole thing strange.. also because it happens only from
time to time.
it must be related to load. when the system is under heavy load
something goes wrong and 2 concurrent transactions get the same unique
id. but how??

peter


--
:: e n d i a n
:: security with passion

:: peter warasin
:: http://www.endian.com   :: peter@endian.com

pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: out of memory - no sort
Next
From: Rich Shepard
Date:
Subject: Re: COPY failure on directory I own