Search Postgresql Archives

Re: Unique constraint violation on serial column

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I did not intend to put explicit values in the
'evt_id' column.  I thought the six values in the
insert command correspond to the 1st six columns in
the create table command, namely d1, obj_id, d2, val,
correction and delta and 'evt_id' is set to the
nextval() automagically.  Is that not correct?

Bill

--- Alvaro Herrera <alvherre@xxxxxxxxxxxxx> wrote:
> 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)
> 


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux