pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Broersma Jr <rabroersma@yahoo.com>
To: Greg Toombs <greg.toombs@bluebottle.com>
To: pgsql-sql@postgresql.org
Subject: Re: A form of inheritance with PostgreSQL
Date: Thu, 8 Mar 2007 12:05:05 -0800 (PST)
Message-ID: <956922.95469.qm@web31812.mail.mud.yahoo.com> (raw)
In-Reply-To: <45F04F8F.8030800@bluebottle.com>

> 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.




view thread (11+ messages)  latest in thread

Message-ID: <956922.95469.qm@web31812.mail.mud.yahoo.com>
Permalink:  ../956922.95469.qm@web31812.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/956922.95469.qm@web31812.mail.mud.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rabroersma@yahoo.com, greg.toombs@bluebottle.com
  Subject: Re: A form of inheritance with PostgreSQL
  In-Reply-To: <956922.95469.qm@web31812.mail.mud.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox