Re: Duplicate serial in Informix 7.2.3
Posted in 2007
>From: Carsten Haese <carsten@uniqsys.com>
>On Thu, 2007-07-26 at 03:25 +0000, Ian Michael Gumby wrote:
> > [...] a serial datatype
> > guarantees uniqueness [...]
>
> > [...] [serial values] were intended to be unqiue [...]
>
>Those are two very different statements, and the first one is, as
>stated, incorrect. In general, a serial column is not per se unique. You
>"accidentally" get unique values if you only ever insert 0 into it, but
>that uniqueness is not guaranteed or enforced by the serial type.
[SNIP]
>Maybe I'm splitting hairs here, but sometimes it's better to be too
>precise.
>
Yes you are splitting hares you silly wabbit. ;-)
Perhaps I could have chose better words, however, we're talking about the
design.
As I stated in an earlier post you have to do a little bit of forensic
computing and look at the design and implementation of what a serial column
is and its inteded use.
You and everyone else is correct in saying that its the combination of the
serial datatype and the backing index that guarantees uniqueness.
If you create a serial datatype in dbaccess, you are forced in to creating
the backing index.
Younger databases offer a similar feature with identity columns that have an
autogenerate feature.
You could say that its a product defect in that when you use a serial
datatype in an sql CREATE TABLE statement, you don't get the index.
-G
_________________________________________________________________
Don't get caught with egg on your face. Play Chicktionary!'
http://club.live.com/chicktionary.aspx?icid=chick_hotmailtextlink2