Re: postgresql table inheritance - Mailing list pgsql-general

From Jeff Davis
Subject Re: postgresql table inheritance
Date
Msg-id 1196450236.22428.386.camel@dogma.ljc.laika.com
Whole thread Raw
In response to Re: postgresql table inheritance  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: postgresql table inheritance  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
List pgsql-general
On Fri, 2007-11-30 at 16:06 +0000, Gregory Stark wrote:
> "Lincoln Yeoh" <lyeoh@pop.jaring.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


pgsql-general by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: PL/pgSQL and SETOF
Next
From: Jeff Davis
Date:
Subject: Re: postgresql table inheritance