X-Original-To: pgsql-hackers-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id A51DD9FA4A8 for ; Tue, 18 Jul 2006 19:07:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 06641-06 for ; Tue, 18 Jul 2006 22:06:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.skype.net (mail.skype.net [195.215.8.149]) by postgresql.org (Postfix) with ESMTP id 610DA9FA47F for ; Tue, 18 Jul 2006 19:06:57 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.skype.net (Postfix) with ESMTP id 3FC994E16B; Wed, 19 Jul 2006 00:06:56 +0200 (CEST) Received: from [10.10.10.6] (217-159-136-226-dsl.kt.estpak.ee [217.159.136.226]) by mail.skype.net (Postfix) with ESMTP id 55E774E043; Wed, 19 Jul 2006 00:06:54 +0200 (CEST) Subject: Re: [SQL] using constraint based paritioning to fix EAV From: Hannu Krosing To: Andrew Hammond Cc: Aaron Bono , pgsql-hackers@postgresql.org In-Reply-To: <1153257622.3681.1.camel@localhost.localdomain> References: <1153238828.426611.113540@35g2000cwc.googlegroups.com> <5a0a9d6f0607181344g530b4d09s393f3f0b46764fbe@mail.gmail.com> <1153257622.3681.1.camel@localhost.localdomain> Content-Type: text/plain; charset=utf-8 Date: Wed, 19 Jul 2006 01:06:52 +0300 Message-Id: <1153260413.3681.6.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.2 (2.6.2-1.fc5.5) Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/737 X-Sequence-Number: 86592 Ühel kenal päeval, K, 2006-07-19 kell 00:20, kirjutas Hannu Krosing: > Ühel kenal päeval, T, 2006-07-18 kell 16:44, kirjutas Andrew Hammond: > > On 7/18/06, Aaron Bono wrote: > > On 18 Jul 2006 09:07:08 -0700, Andrew Hammond > > wrote: > > > > I have a client with the following EAV inspired > > schema. > > > > CREATE TABLE many_tables ( > > table_id text primary key, -- defines which > > virtual table is > > encoded > > attribute1 text, > > attribute2 text, > > attribute3 text, > > attribute4 text, > > ... > > ); > > Maybe you can approach the problem from another end, and make the > many_tables table the virtual one and all the others into real tables ? Oops, I see you kind of are :) Maybe you can solve some of the problems doing a VIEW over pl/SQL function ? And/or maybe using triggers instead of rules. -- ---------------- Hannu Krosing Database Architect Skype Technologies OÜ Akadeemia tee 21 F, Tallinn, 12618, Estonia Skype me: callto:hkrosing Get Skype for free: http://www.skype.com