Re: Abstract identifiers, logical pointers, or foreign keys considered not enough
Date: Sun, 12 Oct 2003 19:53:47 +0300
Message-ID: <3F89871B.5000808_at_atbusiness.com>
Costin Cozianu wrote:
> Lauri Pietarinen wrote:
>
>> Costin Cozianu wrote:
>>
>>> Lauri Pietarinen wrote:
>>>
>>>>
>>>> In my mind the rational for using surrogates in databases is that
>>>> they insulate us from cascading changes in the case that we have to
>>>> change the primary key.
>>>>
>>> But this is a physical level concern. The table holding the foreign
>>> key, may just physically hold a pointer to the record from where it
>>> will get the (foreign key/candidate key)value. Then an "ON UPDATE
>>> CASCADE" will be just as easy as if there was nothing to cascade.
>>
>>
>>
>> Do you mean some kind of table reference, like has been discussed in
>> this thread?
>>
>> RELATION Dept ( Id Dept_Id KEY, Name String );
>> RELATION Emp ( Id Emp_Id KEY, Dept REF(Dept),
>> Name PersonName, Salary Money );
>>
>> RETRIEVE E.Name, DEREF(E.Dept).Name FROM Emp E;
>>
>> RETRIEVE E.Name FROM Emp E, Dept D WHERE DEREF(E.Dept).Id = E.Id
>> AND D.Name = 'shoe';
>>
>>
>> If so, I think this approach will complicate things unnecessarily.
>>
>
>
> Not at all, if this mechanism is part of the physical implementation
> level.
What do you mean by "physical implementation level"? That it is not
visible to the
user (meaning here the one that issued the query)?
>> Regardless of the problem related to changing the identity of
>> entities, in the case I presented, introducing a PAYMENT_ID is a
>> strange way to plumb the inadequacy of a type system.
>>
>> By type system, do you mean datatypes (=Domains) or table types?
>>
>
> Table types are data types, in other words it is not profitable at all
> to have first class types and second class types.
Am I to understand that you do not make a distinction between table
types and scalar, or data types?
What do you understand table types to be? Would, say the table (or relation)
PERSON(ID INTEGER, NAME STRING) be of type (INTEGER, STRING)?
best regards,
Lauri Pietarinen
Received on Sun Oct 12 2003 - 18:53:47 CEST