Re: [SQL] Atomic query and update of sequence generators

2004-01-15 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1

Re: [SQL] Atomic query and update of sequence generators

2004-01-14 Thread Tom Lane
Jeffrey Tenny <[EMAIL PROTECTED]> writes: > If I want to allocate a block of adjacent values from a sequence generator, > is the following statement atomic with respect to the time between > when the call to nextval() and setval()? > SELECT setval('foo', nextval()+20) ... Nope. > The goal is to

[SQL] Atomic query and update of sequence generators

2004-01-14 Thread Jeffrey Tenny
If I want to allocate a block of adjacent values from a sequence generator, is the following statement atomic with respect to the time between when the call to nextval() and setval()? SELECT setval('foo', nextval()+20) ... The goal is to get a sequence of 20 values that are all +1 from each other.