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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: constrain with MATCH full and NULL values in referenced table
Дата
Msg-id 5361.1565623648@sss.pgh.pa.us
обсуждение исходный текст
Ответ на constrain with MATCH full and NULL values in referenced table  (stan <stanb@panix.com>)
Список 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 по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: constrain with MATCH full and NULL values in referenced table
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: constrain with MATCH full and NULL values in referenced table