constrain with MATCH full and NULL values in referenced table

From: stan <stanb(at)panix(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: constrain with MATCH full and NULL values in referenced table
Date: 2019-08-12 15:11:15
Message-ID: 20190812151115.GA8819@panix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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,.

--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-08-12 15:17:33 Re: constrain with MATCH full and NULL values in referenced table
Previous Message Adrien Nayrat 2019-08-12 13:24:13 Re: Fwd: Postgres HA - pacemaker RA do not support auto failback