Re: [GENERAL] Serials jumping

2005-08-26 Thread Joshua D. Drake
Matt A. wrote: I did not know that about every call to nextval, but that does make sense. I need a way to return the new ID of the SERIAL column on INSERT to add the related rows into the proper tables explictly. Similiar to how I could use @@identity to retrive the value in sql2000. Once you

Re: [GENERAL] Serials jumping

2005-08-26 Thread Matt A.
I did not know that about every call to nextval, but that does make sense. I need a way to return the new ID of the SERIAL column on INSERT to add the related rows into the proper tables explictly. Similiar to how I could use @@identity to retrive the value in sql2000. The only ways I saw was ne

Re: [GENERAL] Serials jumping

2005-08-26 Thread Richard Huxton
Matt A. wrote: I have a serial column on a test box DB. I'm using "select nextval('some_seq') as id" to insert a id in sequence. It doesn't return the next value but at least 4 or so (random) ahead of the current value. Is this to be expected? Quite possibly. The sequence generator doesn't ski

Re: [GENERAL] Serials jumping

2005-08-26 Thread Alban Hertroys
Matt A. wrote: I have a serial column on a test box DB. I'm using "select nextval('some_seq') as id" to insert a id in sequence. It doesn't return the next value but at least 4 or so (random) ahead of the current value. Is this to be expected? You probably did some extra selects on the sequenc

[GENERAL] Serials jumping

2005-08-26 Thread Matt A.
I have a serial column on a test box DB. I'm using "select nextval('some_seq') as id" to insert a id in sequence. It doesn't return the next value but at least 4 or so (random) ahead of the current value. Is this to be expected? Is this the most efficient way to retreive an id value for insert a