Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!drn.maxwell.syr.edu!news.maxwell.syr.edu!fr.ip.ndsoftware.net!zen.net.uk!dedekind.zen.co.uk!peer.news.zetnet.net!newsfeed.uk.prserv.net!prserv.net!news.freedom2surf.net!nntp-peering.plus.net!ptn-nntp-feeder03.plus.net!ptn-nntp-spool02.plus.net!ptn-nntp-reader02.plus.net!not-for-mail
Date: Mon, 06 Jun 2005 11:41:32 +0100
From: Paul <paul@test.com>
User-Agent: Debian Thunderbird 1.0.2 (X11/20050602)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: comp.databases.theory
Subject: Re: Translating constraints to RM Terms
References: <ianbn2-dj5.ln1@pluto.downsfam.net> <1118042868.581634.304340@g47g2000cwa.googlegroups.com>
In-Reply-To: <1118042868.581634.304340@g47g2000cwa.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Lines: 32
Message-ID: <42a4285d$0$8719$ed2619ec@ptn-nntp-reader02.plus.net>
Organization: Customer of PlusNet plc (http://www.plus.net)
NNTP-Posting-Host: 1e69924a.ptn-nntp-reader02.plus.net
X-Trace: DXC=;ggdDI:T<AFk5eM?0A74;@igd3Y`7Rb;N37XnI;[OUCDG`jPeGcW;iK@YkCdf3\ibMTnIcO=4dVgFVhh@iY<>hbF
X-Complaints-To: abuse@plus.net
Xref: dp-news.maxwell.syr.edu comp.databases.theory:31233

Marshall Spight wrote:
> But I think I must take exception to your claim that we are defining
> one domain in terms of another. And this rather gets to the heart
> of a question that's been buzzing around the back of my head
> for a year or two, namely: just what is the relationship between
> types and constraints?
> 
> And I in fact have a tentative answer, which is that they are,
> respectively, the compile time and run time behavior of the
> variables. (Alternatively, the static and dynamic behavior
> of the variables.)

Here's an example to think about: I create a domain/type called "Number"
which contains real numbers (maybe chopped off at some min/max values
and some level of decimal places or significant figures). I make a
column with this as the type. Then I add a column constraint like
"round(col) = col" i.e. the value must be an integer.

Is this functionally identical to creating an "integer" type and using that?

To go further, imagine a universal type that was a union of the set of
every possible type you could want. You set every column to this type
and then have column constraints to restrict each column to the values
you want.

Maybe this would link in with the thread on NULLs in that your universal
type would only need a single universal NULL?

Note: I'm not seriously advocating this, just arguing a logical point to
see if it reaches an absurdity.

Paul.
