Re: [GENERAL] guaranteeing that a sequence never skips

2004-10-05 Thread Andre Maasikas
>Sometimes a business requirement is that a serial sequence >never skips, >e.g. when generating invoice/ticket/formal letter numbers. Would an >INSERT INTO t (id, ...) VALUES (SELECT MAX(col)+1 FROM t, ...) >suffice, >or must I install a trigger too to do additional checking? > If id is defin

Re: [GENERAL] guaranteeing that a sequence never skips (fwd)

2004-10-03 Thread Mike Nolan
> Then, every once in a while, a separate process would go in, see the > highest value on idfield < 250M, and rewrite the idfield on all of the > tuples where idfield > 250M. It would be efficient due to the partial > index. It limits the number of documents to 250M, but I'm sure that > can be al

Re: [GENERAL] guaranteeing that a sequence never skips (fwd)

2004-10-03 Thread Christopher Browne
In an attempt to throw the authorities off his trail, [EMAIL PROTECTED] ("Scott Marlowe") transmitted: > On Sun, 2004-10-03 at 11:48, Mike Nolan wrote: >> > On Sun, 2004-10-03 at 08:58, David Garamond wrote: >> > > Am I correct to assume that SERIAL does not guarantee that a sequence >> > > won't

Re: [GENERAL] guaranteeing that a sequence never skips

2004-10-03 Thread Christopher Browne
A long time ago, in a galaxy far, far away, [EMAIL PROTECTED] (David Garamond) wrote: > Am I correct to assume that SERIAL does not guarantee that a sequence > won't skip (e.g. one successful INSERT gets 32 and the next might be > 34)? What is guaranteed is that sequence values will not be repeate

Re: [GENERAL] guaranteeing that a sequence never skips (fwd)

2004-10-03 Thread Scott Marlowe
On Sun, 2004-10-03 at 11:48, Mike Nolan wrote: > > On Sun, 2004-10-03 at 08:58, David Garamond wrote: > > > Am I correct to assume that SERIAL does not guarantee that a sequence > > > won't skip (e.g. one successful INSERT gets 32 and the next might be 34)? > > > > > > Sometimes a business requir

Re: [GENERAL] guaranteeing that a sequence never skips

2004-10-03 Thread Uwe C. Schroeder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sunday 03 October 2004 10:21 am, Scott Marlowe wrote: > On Sun, 2004-10-03 at 08:58, David Garamond wrote: > > Am I correct to assume that SERIAL does not guarantee that a sequence > > won't skip (e.g. one successful INSERT gets 32 and the next migh

Re: [GENERAL] guaranteeing that a sequence never skips (fwd)

2004-10-03 Thread Mike Nolan
> On Sun, 2004-10-03 at 08:58, David Garamond wrote: > > Am I correct to assume that SERIAL does not guarantee that a sequence > > won't skip (e.g. one successful INSERT gets 32 and the next might be 34)? > > > > Sometimes a business requirement is that a serial sequence never skips, > > e.g. wh

Re: [GENERAL] guaranteeing that a sequence never skips

2004-10-03 Thread Scott Marlowe
On Sun, 2004-10-03 at 08:58, David Garamond wrote: > Am I correct to assume that SERIAL does not guarantee that a sequence > won't skip (e.g. one successful INSERT gets 32 and the next might be 34)? > > Sometimes a business requirement is that a serial sequence never skips, > e.g. when generatin

[GENERAL] guaranteeing that a sequence never skips

2004-10-03 Thread David Garamond
Am I correct to assume that SERIAL does not guarantee that a sequence won't skip (e.g. one successful INSERT gets 32 and the next might be 34)? Sometimes a business requirement is that a serial sequence never skips, e.g. when generating invoice/ticket/formal letter numbers. Would an INSERT INTO