Re: Nested Relations / RVAs / NFNF
Date: Wed, 27 Oct 2004 15:10:55 -0400
Message-ID: <vrrolc.khf.ln_at_mercury.downsfam.net>
Marshall Spight wrote:
> "Kenneth Downs" <firstinit.lastname_at_lastnameplusfam.net> wrote in message
> news:7dfolc.m6e.ln_at_mercury.downsfam.net...
>> Marshall Spight wrote: >> > >> > So, on a related note, it's a little weird that we use integers as >> > keys. Integers support e.g. addition, so we are allowed to add >> > two keys together. This is nonsensical. Perhaps, if we want >> > to have surrogate keys, something different from integers >> > might be in order. That brings me to my 2a) idea, which is a >> > datatype that only supports these operations, and none other >> > 1) make me a new one >> > 2) copy >> > 3) test two such values for equality >> > >> > [this idea is not original with me.] >> > >> >> Right now I'm digging around in PostgreSQL, so I relate everything to >> that. They allow type extensions, and have some built-in types, including >> various surrogate ID types, that behave as you describe.
>
> Uh, can you be more explicit? You don't mean OIDs or the serial type, do
> you? I never looked at OIDs very closely.
Yes, the OIDs. The following command:
update zdd.column_deps set oid = 23 where oid = 6669823
yields this result:
ERROR: cannot assign to system column "oid"
Off on a tangent, they also have this nifty:
CREATE SEQUENCE mysequence
INSERT INTO sometable (surrogate_key) values (nextval('mysequence'))
which is much more useful than an IDENTITY type because it allows for multiple sequences inside of one table, though so far I have never needed one.
>
>
>> Those who dislike surrogate keys are probably turning green at the >> thought.
>
> Heck with 'em. Surrogate keys are a fact of life. (Which doesn't mean
> natural keys aren't "better"-- but sometimes you don't have a natural
> key, and you gotta have *some* key.)
>
>
Didn't Bob Dylan say something like:
You gotta key it on somethin',
Oh, You gotta key it on somethin',
Well it may be a surrogate,
Or it may be a natural,
But you gotta key it on somethin'
-- Kenneth Downs Use first initial plus last name at last name plus literal "fam.net" to email meReceived on Wed Oct 27 2004 - 21:10:55 CEST
