Re: [ADMIN] duplicate key violates unique constraint

2007-05-11 Thread Spiegelberg, Greg
> From: Tom Lane [mailto:[EMAIL PROTECTED] > > "Spiegelberg, Greg" <[EMAIL PROTECTED]> writes: > > As you can see, it's only providing the key1 column and the > sequence is > > providing the value for the column with the constraint. > How can this be > > happening? > > Perhaps at some point y

Re: [ADMIN] duplicate key violates unique constraint

2007-05-11 Thread Carol Walter
Yes, I've seen "serial" used in other places than the primary key, but I was referring to Greg's output. The data type for the sequence is listed as "bigint". My thought was that the data type was listed as "serial" for sequences. I just looked at my database and I was wrong about that.

Re: [ADMIN] duplicate key violates unique constraint

2007-05-10 Thread Jim Nasby
On May 10, 2007, at 9:01 AM, Carol Walter wrote: And this is more than a question than an answer, but I thought that sequences had to designated as data type "serial." Nope... sequences are actually completely un-related to tables. You can define a sequence that's not referenced by any table

Re: [ADMIN] duplicate key violates unique constraint

2007-05-10 Thread Mikko Partio
On 5/10/07, Spiegelberg, Greg <[EMAIL PROTECTED]> wrote: List, Check out the value for t1_s_seq on connection #1. 1: db=# select nextval('t1_s_seq'); nextval - 1 (1 row) And check the value for t1_s_seq on connection #2. 2: db=# select nextval('t1_s_seq'); nextval

Re: [ADMIN] duplicate key violates unique constraint

2007-05-10 Thread Tom Lane
"Spiegelberg, Greg" <[EMAIL PROTECTED]> writes: > As you can see, it's only providing the key1 column and the sequence is > providing the value for the column with the constraint. How can this be > happening? Perhaps at some point you manually inserted an id value past the then-current sequence v

Re: [ADMIN] duplicate key violates unique constraint

2007-05-10 Thread Carol Walter
Greg, Since Postgres allows you to insert a value into a field that is designated as a sequence number, is it possible that one was entered that the sequence tried to recreate? And this is more than a question than an answer, but I thought that sequences had to designated as data type "se

[ADMIN] duplicate key violates unique constraint

2007-05-10 Thread Spiegelberg, Greg
List, We're using 8.2.1 in RedHat ES 4 here and I have a simple two column table: data_keys1. Table "public.data_keys1" Column | Type |Modifiers ++-- --- id | bigint | no