Re: [HACKERS] Sequences....

From: "D'Arcy" "J(dot)M(dot)" Cain <darcy(at)druid(dot)net>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us (Tom Lane)
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Sequences....
Date: 1999-03-19 03:38:59
Message-ID: m10Nq7f-0000cCC@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thus spake Tom Lane
> "D'Arcy" "J.M." Cain <darcy(at)druid(dot)net> writes:
> > Alternatively, maybe we can enforce the serialism of the type. Even
> > if the user specifies a value, ignore it and put the next number in
> > anyway.
>
> I don't like that at *all*.

I'm not entirely crazy about it myself. I included it as an option because
it seemed to follow from the definition of serial number. However, in
practice I imagine that people would find it overly restrictive.

> > Do as above but allow the user to specify a number as long as it is
> > available and is lower than the next number in the series.
>
> I think better would be that the sequence value is silently forced to
> be at least as large as the inserted number, whenever a specific number
> is inserted into a SERIAL field. That would ensure we never generate
> duplicates, but not require keeping any extra state.

I see your point but that could cause problems if you start your sequence
too high. I guess the answer to that is, "Don't do that."

Hmm. Are you suggesting that if I insert a number higher than the next
sequence that the intervening numbers are never available?

--
D'Arcy J.M. Cain <darcy(at){druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-03-19 03:39:40 6.5 Features list
Previous Message Clark Evans 1999-03-19 02:50:59 Re: [HACKERS] Removing derived files from CVS