On Tue, Jul 16, 2002 at 03:56:23PM +0100, Alex McLintock wrote:
> At 10:47 16/07/02, Roger Burton West wrote:
> >On or about Tue, Jul 16, 2002 at 10:43:17AM +0100, Peter Haworth typed:
> >
> >>Surely you shouldn't rely on sequences being contiguous, anyway? Who cares
> >>if your test eats up some values; their only purpose should be to ensure
> >>uniqueness.
> >
> >Contiguity becomes important when you're doing things like generating
> >invoice numbers.
> >Roger
> 
> 
> For the record I hit this sort of problem doing some perl web stuff with 
> Oracle.
> It seemed that because Oracle was multiprocessor each oracle process would 
> grab for itself the next 20 ids. if you stopped and started the server 
> there would be a gap of 19 between consecutive requests....

This happens with postgres too. Because each client gets a new backend 
process, the sequence can only be guaranteed to increment safely. It can't
be guranteed to increase by only one.

MSSQL works in the expected manner. It's about the only one I can think of.

Using a database id generator strikes me as a not good thing for meaningful
incremental values tho :)

Oracle, MSSQL (it's fiddly but you can) and Postgres have mechanisms to reset
a counter or sequence explicitly. The mysql way strikes me as a very bad thing
given that it could create invalid relationships sometimes (possibly).

Who knows ...

nic
-- 
the light at the end of the tunnel is a freight train heading my way


Reply via email to