Re: Can foreign keyed field allow nulls?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: lbottorff(at)harveycounty(dot)com
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Can foreign keyed field allow nulls?
Date: 2001-03-05 19:49:47
Message-ID: Pine.BSF.4.21.0103051147500.63635-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


On Mon, 5 Mar 2001 lbottorff(at)harveycounty(dot)com wrote:

> I have a table with a field I'd like to do a REFERENCES to a lookup table on;
> however, this field is not manditory, i.e., can be NULL. Is it possible to do
> such a thing?

Maybe. If the key is a single column, it should be fine. If it's a
multi-column key then it depends on what match type you are using. For
MATCH FULL, all the columns must be null or none of the columns may be
null. For the unspecified match type you can have a null in the key but
such a key will always succeed.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Christian Anton 2001-03-05 21:47:14 Re: createdb fails - Newbie
Previous Message lbottorff 2001-03-05 19:29:58 Can foreign keyed field allow nulls?