On Mon, Nov 29, 2004 at 03:47:27PM -0500, [EMAIL PROTECTED] wrote: > So does post not update a SERIAL column sequence when id's are > manually entered? Would I have to manually do a nextval on the seq > when manually setting id's? Should't post know that i used an id > number and use the next availible number, something like ( (the > largest id number in the key) + increment_val )?
SERIAL is just a convenient way of creating an INTEGER column with a default value. If you provide a value for that column then the default isn't used, so the INSERT never calls nextval() to increment the sequence. If you need to set some of the SERIAL column's values explicitly, e.g., when importing data, then you can use ALTER SEQUENCE or setval() when you're finished to change the sequence's value. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match