Re: Foreign superkey support

From: Marshall <marshall.spight_at_gmail.com>
Date: 8 Aug 2006 22:10:37 -0700
Message-ID: <1155100237.103860.180160_at_h48g2000cwc.googlegroups.com>


erk wrote:
>
> Some database constraints restrict only the domain of tuples allowed in
> a specific relvar, so are relation constraints (i.e. they are
> expressions over only the attributes of a single relvar). Other more
> specific constraints are type constraints and attribute constraints
> (expressions over a single attribute or attribute type).

I have read various classification systems for constraints, and they all seem unnecessary to me. They don't really buy me much if anything. While on the one hand it is quite tempting to consider a constraint as having some particular scope, especially if it can be pinned on a particular relvar, it doesn't really hold up. For any constraint, we have a set of relations that it is quantified over. If that set is cardinality one, that is just particular to that constraint;
it doesn't classify it per se. We don't consider the cardinality of one side of other many-to-many relationships as being classifying, do we?

In other words, there is a many-to-many relationship between constraints and relvars. (Or relations, if we are thinking in descriptive rather than prescriptive terms.) For example, we often speak of a foreign key constraint as belonging to one particular table, but it is equally a constraint on two tables. On one table it restricts inserts and on another table it restricts deletes. So we must necessarily classify it as a database constraint. But really, all constraints are all database constraints, although there may be some database constraints that only happen to be quantified over a single relvar.

Just my perspective, anyway.  

Marshall Received on Wed Aug 09 2006 - 07:10:37 CEST

Original text of this message