Re: postgresql table inheritance

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>, pgsql-general(at)postgresql(dot)org
Subject: Re: postgresql table inheritance
Date: 2007-11-30 19:17:16
Message-ID: 1196450236.22428.386.camel@dogma.ljc.laika.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2007-11-30 at 16:06 +0000, Gregory Stark wrote:
> "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.
>

CJ Date believes that normalized relations can indeed contain complex
types such as images or other relations.

The argument is that atomicity has no absolute meaning, but only has
meaning in the context of what you're trying to do with it in the
database. A string can obviously be decomposed into its parts, as can a
timestamp, etc., so those aren't exactly atomic, either. [1]

The impedance mismatch has more to do with the fact that the meaning of
an application's internal data structures changes frequently (through
revisions of the code), while data in a database needs to be consistent
across long periods of time. So, a well-designed database will hold
facts that have meaning in the real world and from which inferences can
be made. Mapping application data structures (which contain context-
sensitive information and implementation artifacts) to real-world facts
is the impedance mismatch.

Regards,
Jeff Davis

[1] Paraphrased from "Database in Depth", C.J. Date, pp 29-32

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2007-11-30 19:30:30 Re: postgresql table inheritance
Previous Message Pavel Stehule 2007-11-30 18:18:04 Re: PL/pgSQL and SETOF