Re: postgresql table inheritance

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Lincoln Yeoh" <lyeoh(at)pop(dot)jaring(dot)my>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: postgresql table inheritance
Date: 2007-11-30 16:06:38
Message-ID: 87prxr3egh.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


"Lincoln Yeoh" <lyeoh(at)pop(dot)jaring(dot)my> writes:

> The correct way to store types and subtypes in the database is to store them
> in the columns. In other words, choose attribute VALUES from a TYPE SYSTEM.
> Nothing else in the relational model needs to be changed. Something like
> this, in hypothetical SQL-like language:

That's what we call "denormalized" data in the database world. This is why
there's such a big impedance mismatch between procedural languages and
relational databases.

The natural place to end up in his world would be to have every table have
precisely one column which is some kind of object. Then you access fields and
methods on those objects.

The problem is that then you don't have a relational database since it's
awfully hard to tell the database you have a foreign key from whatever this
method returns here to whatever that method returns there for some record
somewhere... And it's awfully hard to index and join between complex
expressions picking data out from inside objects on both sides, etc.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's PostGIS support!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-11-30 16:13:19 Re: Record variable not behaving as expected (bug?)
Previous Message Alvaro Herrera 2007-11-30 16:04:27 Re: FK index q'n