Re: [GENERAL] Am I using the SERIAL type properly?

2003-07-12 Thread Jeffrey Melloy
If you use a serial datatype, it simply says the *default* behavior is to use the next value of sequence a. So you can insert 1, 2, 10,204,492 into the column just fine. However, by inserting data into something you want to auto-increment, you can run into non-uniqueness. (Like you were).

Re: [GENERAL] Am I using the SERIAL type properly?

2003-07-11 Thread Martijn van Oosterhout
On Thu, Jul 10, 2003 at 12:10:31AM -0700, Chad N. Tindel wrote: I tried doing numerous searches to see if this has been discussed before, but I couldn't find anything. If it has, perhaps my question can be answered simply by a pointer to a previous thread. I'm trying to convert a program

Re: [GENERAL] Am I using the SERIAL type properly?

2003-07-11 Thread Jeffrey Melloy
drop table A; create table A ( id SERIAL PRIMARY KEY, foo int default 5, bar int default 10 ); insert into A (id, foo, bar) values (1, 1, 1); insert into A (id, foo, bar) values (2, 2, 2); insert into A (id, foo, bar) values (3, 3, 3); insert into A (id, foo, bar)