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 1hxC4w-00066C-BT for pgsql-general@arkaria.postgresql.org; Mon, 12 Aug 2019 15:17:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hxC4v-0003a7-0c for pgsql-general@arkaria.postgresql.org; Mon, 12 Aug 2019 15:17:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hxC4t-0003R4-JJ for pgsql-general@lists.postgresql.org; Mon, 12 Aug 2019 15:17:44 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hxC4p-0002Pd-LR for pgsql-general@postgresql.org; Mon, 12 Aug 2019 15:17:43 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 4FD7D29E; Mon, 12 Aug 2019 11:17:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 12 Aug 2019 11:17:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=4 XmjAoz3IycebIziEAwmhNOgrzpb+zvdS8xiKP73p/0=; b=P2NB1mHqiRxg3O94V 1tRYN+jpTnQ1u62yjnQ3iZkrz8hU8MC94J4NF3jC0HlZknci73afDQzvsGZg/CNz wa6uJyzYqa/heq57+h4lZD7h30AuOPCAH9HQHAf6SADF7y7bhvSHXq9SXRmuWApg yq7CeRPqWrL4JyKZNds7xk8qCnosF+6skWdwyMPeHt/OyJ62PjKe5qB07JspFVU+ rz7kUu4tpksaZqZdDxExM+DPRxJTRsurWpy9Wy1ZgSyRdmwaSnnfjD7lRNSbVvV0 NKracLpOb/kgIpnF2zhyznSTeDZetWkitBUkIOmEUck8wlopXU0tZvYwN/mYkyve s3ocg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=4XmjAoz3IycebIziEAwmhNOgrzpb+zvdS8xiKP73p /0=; b=eVke3N0LRAyCbxQ1gzi4ZANQvds+b28euoGsM0lMO6nPFTr4j8mPqWL9A 9aRE5mnq3RLP5UvqNs8EzggkNxJpMo+/VUnT02MNDKNBGalfIPzFgeKzJi2/I2vy alQlLrZWfrXwTkuXRzLMdvb+7EyRjiIhMAGJQ+6GS/V5piwxavYWrAxjyTQP5IBS Wf1vec2o/yjHJl3GKOOCDU8f5Nz6rtjZy7/Ef28xHMIibPvvQhclmat1WgoNNta/ aiA3IuqwyRVzdQBewdJAywU+Q0ixHVqiDVVOl6eMyBDM+hanHjOqk/8J6FH96v4r WC6BOLbeK5XwCFh2pyHkyDg+QG96g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddruddvgedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtje ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuffhomhgrihhnpehpohhsthhgrhgvsh hqlhdrohhrghenucfkphepjeegrdelfedruddthedrudekieenucfrrghrrghmpehmrghi lhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhenucevlh hushhtvghrufhiiigvpedt X-ME-Proxy: Received: from ranger.suse (74-93-105-186-washington.hfc.comcastbusiness.net [74.93.105.186]) by mail.messagingengine.com (Postfix) with ESMTPA id BC6AF38008C; Mon, 12 Aug 2019 11:17:34 -0400 (EDT) Subject: Re: constrain with MATCH full and NULL values in referenced table To: stan , pgsql-general@postgresql.org References: <20190812151115.GA8819@panix.com> From: Adrian Klaver Message-ID: <71e23df2-57ea-9d53-da33-5a5a0d4d695d@aklaver.com> Date: Mon, 12 Aug 2019 08:17:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190812151115.GA8819@panix.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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.klaver@aklaver.com