Re: MV counterexample

From: Anthony W. Youngman <wol_at_thewolery.demon.co.uk>
Date: Fri, 7 May 2004 19:42:16 +0100
Message-ID: <W02yWkLIi9mAFwaE_at_thewolery.demon.co.uk>


In message <409b4ddf$1_at_post.usenet.com>, x <x-false_at_yahoo.com> writes
>> Bearing in mind that apparently, in order to have real data integrity,
>> we need user-defined primary data types, how on earth is that going to
>> be PRACTICAL without pushing at least some integrity checks into
>> user-space.
>
>> A database relies on metadata to do integrity checks. Certainly with
>> current RDBMSs, a major function of analysis is to convert metadata into
>> data. Without some way of converting that data back into metadata (ie
>> giving the user the ability to modify the operation of the database
>> engine) there is no way the dbms is going to be able to apply any
>> integrity check that relies on that sort of (meta)data.
>
>I don't understand this.
>Could you be more specific ?

Okay. Simple. Let's take a data type of "sex".

According to ISO, this has four values, namely "male", "female", "irrelevant", "unknown".

We can enforce this (do our integrity check) with a trigger - that's user space.

Or we can use a foreign key into a lookup table - at which point it ceases to be a "user defined data type", because we may have a situation where the data consists of a (variable) range and/or special values - for example "age" is normally a number but can have the values "unknown" or "dead".

If we want to have user-defined datatypes like "age" or "sex", the user is going to have to be able to program (in some sense or other) the integrity checks, therefore integrity checking must be a user-space phenomenon. I just don't see how you can get round it. By definition, the database itself cannot use data to do primary integrity checks - it needs metadata. But the user can't provide metadata because the database itself has no way of understanding it - it'll think it's data. Catch 22.

Cheers,
Wol

-- 
Anthony W. Youngman - wol at thewolery dot demon dot co dot uk
HEX wondered how much he should tell the Wizards. He felt it would not be a
good idea to burden them with too much input. Hex always thought of his reports
as Lies-to-People.
The Science of Discworld : (c) Terry Pratchett 1999
Received on Fri May 07 2004 - 20:42:16 CEST

Original text of this message