Re: inheritance and primary/foreign keys - Mailing list pgsql-general

From missive@frontiernet.net (Lee Harr)
Subject Re: inheritance and primary/foreign keys
Date
Msg-id 98c25g$1mn0$1@node17.cwnet.frontiernet.net
Whole thread Raw
In response to Re: inheritance and primary/foreign keys  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
On Fri, 9 Mar 2001 19:34:31 +0000 (UTC), Stephan Szabo
<sszabo@megazone23.bigpanda.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?

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Create trigger problem :
Next
From: "Jack"
Date:
Subject: a psql windows version?