From: | "Ross J(dot) Reedstrom" <reedstrm(at)wallace(dot)ece(dot)rice(dot)edu> |
---|---|
To: | The Hermit Hacker <scrappy(at)hub(dot)org> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Chris Bitmead <chris(at)bitmead(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Re: ORDBMS |
Date: | 2000-01-28 17:51:24 |
Message-ID: | 20000128115124.D11642@rice.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Fri, Jan 28, 2000 at 11:02:32AM -0400, The Hermit Hacker wrote:
> On Fri, 28 Jan 2000, Tom Lane wrote:
>
> > Chris Bitmead <chris(at)bitmead(dot)com> writes:
> > > Tom Lane wrote:
> > >> For a lot of this older stuff, there isn't even any documentation
> > >> (that I know of) on what it's *supposed* to do, let alone on how
> > >> thorough the original implementation was.
> >
> > > I thought that the original berkeley doco covered this to some extent.
> >
> > Where would I find that?
> >
> > > Basicly I think you're supposed to be able to go...
> >
> > > CREATE TABLE address (street TEXT, number TEXT, suburb TEXT, zip TEXT);
> > > CREATE TABLE person (name TEXT, address ADDRESS);
> >
> > > SELECT name, address FROM person WHERE person.address.suburb = 'New
> > > York';
> >
> > Hmm. This looks like a CREATE TABLE implicitly creates a datatype
> > that acts more or less like a C 'struct' declaration, ie, it's just a
> > collection of subfields. OK, a struct-making declaration is certainly
> > useful. What I don't understand yet is whether the contents of table
> > "address" have any connection to the data stored in table "person".
> > If not, why must I create a table in order to define a datatype? Seems
> > like a separate CREATE DATATYPE command would make more sense...
>
> Not quite an answer to your question, but my guess is that 'address
> ADDRESS' would contain a pointer (OID) to the address table ... so the
> person table would be realtively small in comparison to the address table
> ...
>
> The way I look at the above, its a 'JOIN' at table create time, based on a
> unique value, the OID ...
>
Ah, so attribute inheritance implements "is-a" relationships, and classes
as datatypes implements "has-a"?
> How 'dep' can you go with this? ie:
>
> CREATE TABLE address (street TEXT, number TEXT, suburb TEXT, zip TEXT);
> CREATE TABLE telephone ( home TEXT, business TEXT, fax TEXT );
> CREATE TABLE person (name TEXT, address ADDRESS, telephone TELEPHONE);
>
> Question, if I did an INSERT person VALUES ('myname');
>
> What happens to the address table? a row gets created with all NULL? Or?
Nothing, the address attribute for that person is NULL. At least, That's
what I'd want it to do.
Ross
--
Ross J. Reedstrom, Ph.D., <reedstrm(at)rice(dot)edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2000-01-28 17:53:19 | Copyright |
Previous Message | Adriaan Joubert | 2000-01-28 17:43:40 | Bit strings |