Re: inheritance and primary/foreign keys

From: missive(at)frontiernet(dot)net (Lee Harr)
To: pgsql-general(at)postgresql(dot)org
Subject: Re: inheritance and primary/foreign keys
Date: 2001-03-10 02:05:36
Message-ID: 98c25g$1mn0$1@node17.cwnet.frontiernet.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 9 Mar 2001 19:34:31 +0000 (UTC), Stephan Szabo
<sszabo(at)megazone23(dot)bigpanda(dot)com> wrote:
>
>On Fri, 9 Mar 2001, Einar Karttunen wrote:
>
>> On Wed, 7 Mar 2001, Stephan Szabo wrote:
>> >
>> > You cannot safely reference tops of inheritance trees under 7.0 or 7.1 and
>> > have it reference the trees.
>> >
>> Is there anyway to emulate this? I want to have several types of persons
>
>Someone's been trying to get a workaround. Hopefully if they get it done,
>they'll post it to the list. However it's still fairly ugly.
>

I was working on something very similar to this.

What I did was have all of the records get serial numbers from the same
sequence, and use a function ( "is_person" ) to tell whether or not the
id was valid.

I went back and forth about making these tables use inheritance. Really the
only thing I wanted was to have unique "person_id"s for everyone and I
don't think it is necessary to use the actual inheritance mechanism to
implement this.

What other advantages are there to using inheritance?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ben 2001-03-10 02:12:06 Re: what's going on here?
Previous Message Ben 2001-03-10 02:02:38 Re: what's going on here?