Re: Unique constraint violation on serial column - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Unique constraint violation on serial column
Date
Msg-id 20050412154742.GF17283@dcc.uchile.cl
Whole thread Raw
In response to Re: Unique constraint violation on serial column  (Bill Chandler <billybobc1210@yahoo.com>)
List pgsql-general
On Tue, Apr 12, 2005 at 07:59:55AM -0700, Bill Chandler wrote:
> I'm sorry, was working on little sleep yesterday.  You
> are right, the table was created with the columns in
> the following order:
>
> d1, obj_id, d2, val, correction, delta, evt_id
>
> The insert command looks something like:
>
> INSERT INTO EVENT_TBL VALUES(1039850293991, 145,
> 1039110343000, '10.25', 1, 739950991)

So you are indeed inserting constant values in your serial field.  (Bad
idea.)  Why are you doing that (i.e. why aren't you using nextval()),
and do you have numbers bigger than the sequence's current value already
in the table?

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"Uno combate cuando es necesario... ¡no cuando está de humor!
El humor es para el ganado, o para hacer el amor, o para tocar el
baliset.  No para combatir."  (Gurney Halleck)

pgsql-general by date:

Previous
From: Patrick.FICHE@AQSACOM.COM
Date:
Subject: Re: Get Number of milliseconds for an intervall
Next
From: Bill Chandler
Date:
Subject: Re: Unique constraint violation on serial column