Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 5D5379FBFD2 for ; Thu, 8 Mar 2007 16:05:21 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 36087-01-5 for ; Thu, 8 Mar 2007 16:05:09 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from web31812.mail.mud.yahoo.com (web31812.mail.mud.yahoo.com [68.142.207.75]) by postgresql.org (Postfix) with SMTP id E63809FBFDC for ; Thu, 8 Mar 2007 16:05:07 -0400 (AST) Received: (qmail 95956 invoked by uid 60001); 8 Mar 2007 20:05:06 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=TrCnh+uXwoUKM6JLD0t7cDjpSj2Qv7CsbE9VSAjhTE6Ov+xfySf8c3d2sMg6LFlqMGmh7PKLNmjIECojfxssiRO/ri3E2ZTfogk1ID891PAa0mtFBTZe5NMlJCdubadiOQxQ4M2CB9EvUF99oqMxol5DaZ0Fa2e8IRyWAtBRYWE=; X-YMail-OSG: vQjAjE4VM1mdb1k5eauN3GfHF8u4SFm_7.4TEoyEzsLXfmzFgbcDGECeRURiBkALRcd6quWh.IJ4gxc5D1tEsANiihOMX5N2PjVR1pcNib84QHdZXQHZozwJnOx4if9E5oKNMwiiEIK0p.A5DZeZGOAxfrRKApcdnzu4Vhx0A.xH Received: from [63.203.180.122] by web31812.mail.mud.yahoo.com via HTTP; Thu, 08 Mar 2007 12:05:05 PST Date: Thu, 8 Mar 2007 12:05:05 -0800 (PST) From: Richard Broersma Jr Subject: Re: A form of inheritance with PostgreSQL To: Greg Toombs , pgsql-sql@postgresql.org In-Reply-To: <45F04F8F.8030800@bluebottle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <956922.95469.qm@web31812.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.308 tagged_above=0 required=5 tests=AWL, BAYES_50, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS X-Spam-Level: ** X-Archive-Number: 200703/84 X-Sequence-Number: 27722 > I want to design the foreign key scheme such that there are relationsbetween > fruit and apple, and fruit and orange, that imply that apple isa fruit, > and orange is a fruit. Sometime in the future, you will be able to achieve this beautifully and easily using postgresql's feature known as table-inheritance. Right now it can already support hierchey between different types of fruit, however it does not allow for foreign key relationships. However, I figured out a work-around using seperate a table for each entity of the heirchey. And then I rolled up these entities using views made update-able with the Postgresql rule system. Here is a link were I present how it is done. http://archives.postgresql.org/pgsql-general/2006-12/msg00913.php Let me know if you have any questions. Regards, Richard Broersma Jr.