Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] Postgresql 8.3X supports Arrays of CompositeTypes?

From: David Fetter <david(at)fetter(dot)org>
To: Robson Fidalgo <rdnf(at)cin(dot)ufpe(dot)br>
Cc: pgsql-docs(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Postgresql 8.3X supports Arrays of CompositeTypes?
Date: 2009-04-20 14:27:45
Message-ID: 20090420142744.GM4235@fetter.org (view raw or flat)
Thread:
Lists: pgsql-docspgsql-general
On Mon, Apr 20, 2009 at 08:13:15AM -0300, Robson Fidalgo wrote:
> Hi David,
> 
> Thanks for your help, but I want a relational-object solution.

You can have one without denormalizing.  Just use VIEWs and rewrite
RULEs for INSERTs, UPDATEs and DELETEs on them.

> The solution presented by Tom Lane (Thanks Tom!!!!) runs very well
> and it is a relational-object implementation (I suggest put a
> similar example in postgresql 8.3X documentation).

The docs already contain an example:

http://www.postgresql.org/docs/current/static/rules-update.html

There are excellent reasons not to encourage people to do only half
the job.  One part, the smaller part, is presenting an interface which
one part of your OO code can talk to.  The other part, and the much
larger one, is having a well-indexed, normalized data store
underneath.

Example: Under the store-the-compound system you're proposing, how do
you find all the people who have a common prefix?  Answer: Normalize.
If you need that answer quickly, you're looking at down time and DDL
changes.  The questions you ask about the data are impossible to know
in advance, so normalized data helps you deal with that.

Cheers,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

pgsql-docs by date

Next:From: Merlin MoncureDate: 2009-04-20 21:51:18
Subject: Re: Postgresql 8.3X supports Arrays of Composite Types?
Previous:From: Peter EisentrautDate: 2009-04-20 14:20:34
Subject: Re: role hierarchy

pgsql-general by date

Next:From: Oliver Kohll - Mailing ListsDate: 2009-04-20 14:41:31
Subject: New 8.4 features
Previous:From: Martijn van OosterhoutDate: 2009-04-20 14:13:35
Subject: Re: xlog vs. shmfs

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group