Re: constrain with MATCH full and NULL values in referenced table

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: stan <stanb(at)panix(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: constrain with MATCH full and NULL values in referenced table
Date: 2019-08-12 15:17:33
Message-ID: 71e23df2-57ea-9d53-da33-5a5a0d4d695d@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8/12/19 8:11 AM, stan wrote:
> 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.

Without the table schema it difficult for me to figure out what it is
you are attempting.

See below for how MATCH FULL works:

https://www.postgresql.org/docs/11/sql-createtable.html

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

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2019-08-12 15:27:28 Re: constrain with MATCH full and NULL values in referenced table
Previous Message stan 2019-08-12 15:11:15 constrain with MATCH full and NULL values in referenced table