Re: Partial foreign keys, check constraints and inheritance - Mailing list pgsql-general

From Greg Stark
Subject Re: Partial foreign keys, check constraints and inheritance
Date
Msg-id 87hdaar5nt.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Partial foreign keys, check constraints and inheritance  (Jaime Casanova <systemguards@gmail.com>)
List pgsql-general
> On 11/17/05, Eric E <whalesuit@gmail.com> wrote:
> >
> > What's the best way to do this?  My immediate reaction is that I want a
> > partial foreign key, but perhaps this is not a good way to go about such
> > a design.

Normally I just have multiple columns with all but one NULL.

Alternatively you can make it a many-to-many relationship. So you have a
problem table and then you have a problem_product, problem_customer, and a
problem_order table.

--
greg

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Strange slow database
Next
From: Christopher Browne
Date:
Subject: Re: Rebranding PostgreSQL