Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 042686338CC; Mon, 20 Apr 2009 11:28:10 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 19470-02; Mon, 20 Apr 2009 11:28:08 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fetter.org (start.fetter.org [66.92.188.65]) by mail.postgresql.org (Postfix) with ESMTP id 452C1633D8D; Mon, 20 Apr 2009 11:27:47 -0300 (ADT) Received: by fetter.org (Postfix, from userid 500) id 30B3EFBC994; Mon, 20 Apr 2009 07:27:45 -0700 (PDT) Date: Mon, 20 Apr 2009 07:27:45 -0700 From: David Fetter To: Robson Fidalgo Cc: pgsql-docs@postgresql.org, pgsql-general@postgresql.org Subject: Re: [GENERAL] Postgresql 8.3X supports Arrays of Composite Types? Message-ID: <20090420142744.GM4235@fetter.org> References: <41534c40904191403m2eeabc27tc4bc6ce206c87464@mail.gmail.com> <20090419235619.GB10700@fetter.org> <41534c40904200413y60b140a4wf4305c36efd214c0@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41534c40904200413y60b140a4wf4305c36efd214c0@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/45 X-Sequence-Number: 5133 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 http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fetter@gmail.com Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate