Re: constrain with MATCH full and NULL values in referenced table - Mailing list pgsql-general

From Tom Lane
Subject Re: constrain with MATCH full and NULL values in referenced table
Date
Msg-id 5361.1565623648@sss.pgh.pa.us
Whole thread Raw
In response to constrain with MATCH full and NULL values in referenced table  (stan <stanb@panix.com>)
List pgsql-general
stan <stanb@panix.com> writes:
> I am creating a table that has 2 values in it which are keys pointing to 2
> other tables. I need for the UNIQUE combination of these 2 keys to exist in
> a fourth table. It has been recommended to use a foreign key constraint with
> the MATCH FULL parameter. 
> Here is my question, does this deal with NULLS in the 4th table? I am
> concerned that this constraint might fail to reject an entry if one, or both
> of the 2 key values being inserted in the table are NULLS,.

If you don't want nulls there, maybe add NOT NULL constraints to those
columns?

            regards, tom lane



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: constrain with MATCH full and NULL values in referenced table
Next
From: Adrian Klaver
Date:
Subject: Re: constrain with MATCH full and NULL values in referenced table