Re: relation types

From: Bob Badour <bbadour_at_golden.net>
Date: Fri, 5 Sep 2003 12:02:23 -0400
Message-ID: <mD36b.550$NE7.51862636_at_mantis.golden.net>


"Paul Vernon" <paul.vernon_at_ukk.ibmm.comm> wrote in message news:bja6u2$1aai$1_at_gazette.almaden.ibm.com...
> "Bob Badour" <bbadour_at_golden.net> wrote in message
> news:cAP5b.507$Jc6.48843821_at_mantis.golden.net...
> [snip]
> > I agree that the most specific type of both values is equal; however,
D&D do
> > not seem to define the relational operations in terms of most specific
type.
> [snip]
>
> > The statement in RM Prescription 10 is really just a subset of the
statement
> > in RM Prescription 24. I think we both see a flaw, but take different
> > approaches to resolving the flaw. If the relational operations operate
on
> > values, how can they infer constraints unless constraints apply to
values?
>
> Humm, good stuff Bob..
>
> I guess (one of) my issues is: If relation values have constraints, where
it that
> information
> held ?

In the literal that describes the value.

> > I
> > resolve this by noting that these generic operations operate on declared
> > types rather than most specific types; thus, a constraint declared for a
> > relation affects the type of the result of an operation.
>
> > You resolve this by tossing constraint inference.
>
> for values, not variables.

Fair enough, but you suggest we ignore D&D's model for view updatability, which makes constraint inference for variables less important.

> But does it make sense to say the relational operators operate on
variables and
> relational expressions as well as values?

Ordinarily, assignments (and assignment shorthands) operate on variables and all other operations operate on values. It does not matter to most operations whether the value is the current value of some variable or derived from some expression or a literal.

> If I can only ever look at a value via some variable, then I can just look
at the
> constraints on the variable. If I look at a value directly,so to speak,
then indeed
> I only know it's set of <attribute:type> pairs, and nothing
> about it's declared constraints.

Unless the language allows one to include constraints in the literal specification.

> [snip]
> > It really boils down to the difference between declared types and most
> > specific types. It seems to me that we cannot apply the relational
> > operations to values unless they have some declared type including
declared
> > constraints.
>
> We can apply them, we just loose constraint inference if we have no value
> constraints.

We lose all the relational operations if the relational operations are defined to infer constraints with a mandatory candidate key constraint.

> [snip]
> > I agree that it involves the difference between declared type and most
> > specific type, but I am not certain we should limit declared type to
> > relvars.
>
> I need more thought here. I want to consider what this means to database
values.
> Database values do have some place to hold the information about
constraints - in
> catalog tuples...

Whether the catalog is an operation on a database variable or a relation variable or a relation is someone arbitrary. Received on Fri Sep 05 2003 - 18:02:23 CEST

Original text of this message