Re: Partial foreign keys, check constraints and

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Eric E <whalesuit(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Partial foreign keys, check constraints and
Date: 2005-11-17 20:57:28
Message-ID: 1132261048.3582.121.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2005-11-17 at 13:36, Eric E wrote:
> Eric E wrote:
>
> >> maybe you can solve it adding a new col and allow both to contain
> >> null values.
> >>
> >> if these are not mutually exclusive you can avoid a check if they are
> >> check that if one has a non-null value other has null...
> >
> > I did think about that, but I disliked the idea of two fields of nulls
> > for every one full field.... maybe it's not as bad a way of doing it
> > as I thought.
>
> BTW, in most cases I have 5+ tables to do this, so that's 4+ fields of
> null in each row...

Could you use some kind of intermediate join table, so that it pointed
to orders and then products / customers / othermidlevel tables pointed
to it, and so did the problems table?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Mitchell 2005-11-17 21:05:47 Strange slow database
Previous Message Josel Malixi 2005-11-17 20:27:46 unsubscribe