Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hxByt-0005ng-ID for pgsql-general@arkaria.postgresql.org; Mon, 12 Aug 2019 15:11:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hxByq-0008NC-JX for pgsql-general@arkaria.postgresql.org; Mon, 12 Aug 2019 15:11:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hxByq-0008Jy-6y for pgsql-general@lists.postgresql.org; Mon, 12 Aug 2019 15:11:28 +0000 Received: from mailbackend.panix.com ([166.84.1.89]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hxByg-0002qo-OM for pgsql-general@postgresql.org; Mon, 12 Aug 2019 15:11:24 +0000 Received: from panix2.panix.com (panix2.panix.com [166.84.1.2]) by mailbackend.panix.com (Postfix) with ESMTP id 466fSM600fz1KvG for ; Mon, 12 Aug 2019 11:11:15 -0400 (EDT) Received: by panix2.panix.com (Postfix, from userid 17622) id 466fSM57G6z1ZVM; Mon, 12 Aug 2019 11:11:15 -0400 (EDT) Date: Mon, 12 Aug 2019 11:11:15 -0400 From: stan To: pgsql-general@postgresql.org Subject: constrain with MATCH full and NULL values in referenced table Message-ID: <20190812151115.GA8819@panix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Editor: gVim User-Agent: Mutt/1.12.1 (2019-06-15) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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