Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pIdbE-00016O-Va for pgsql-general@arkaria.postgresql.org; Thu, 19 Jan 2023 22:41:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pIdbD-0002ZN-SU for pgsql-general@arkaria.postgresql.org; Thu, 19 Jan 2023 22:41:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pIdbC-0002YK-5W for pgsql-general@lists.postgresql.org; Thu, 19 Jan 2023 22:41:35 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pIdb6-0001xr-Ho for pgsql-general@postgresql.org; Thu, 19 Jan 2023 22:41:33 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 80B1A32003F4 for ; Thu, 19 Jan 2023 17:41:24 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 19 Jan 2023 17:41:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm2; t=1674168084; x=1674254484; bh=9oFvfCLwEY kQD7FtUH1FHGaQTF0YLt5P9to6OH6ykFw=; b=LyOVN0K0C/uHx4kOncbyBYgLtK n0r6Nppb1WFq+MAV6Fq06E74OJI+dfhSkQum7mzE/on2MXooa2pmnNKjL1KcDlbN 0dEwONDCymqRU/EW+PP2c+ztG1RpipJ8whlP23SjhYyG8pSgc3yfE+LsiUX/MNfz 8fvGUtEhZoXmhO1YgYVhtUurDOqEKpTi/h2QgIOUrFhagLdpYnE2BPZB14X1dIgU bXI/0FmB5t12pHO8cai9OlztenDLs0bs4ppojtqiywO0hkYc/XfLDkUvkH3ViQwd D+Ar7AfzWOR8Lv6GbgiP6eOlrQJ3+PCLPohD2+80hCwBMxAl6N1JdhBrTZ8A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1674168084; x=1674254484; bh=9oFvfCLwEYkQD7FtUH1FHGaQTF0Y Lt5P9to6OH6ykFw=; b=oK/LK0Ng7FBQCZNGkpLHB4uBi0fqD+M9QOTivSUk17tU 3yAk+8DauYkTXW1nDpXNSjYaZdsrVMxjsUBoHERXNml8/V1Z2Dg1Kix+Zf5+UAHm 3rQEG7ugasfqx06xUt2guGJP8VGJkh3mCKlFMyIL6othXd/je9JcWpDeSlHtjsNs rH+G53LK6oYVbHOktOGJVoK2RJA3FQiNIDo1fndlhMp9k5P99r73b3/S/DpoR4/9 pCtjRkNJa5gXNFFSnRbmQcSipTraZPWBT3xtvm222wEac73sM/z13syz2q/6VAZP lv0BWPEO5RWWW78/B7/JGz0rr+XxD/QB9cnS8icy2Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudduuddgtddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfvhffutgfgsehtjeertd dtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgr vhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepfeefvdekgfffge egheehheffhfeltefhfeeuvedvtdfgudeiudellefhiefhtddtnecuffhomhgrihhnpehp ohhsthhgrhgvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 19 Jan 2023 17:41:23 -0500 (EST) Message-ID: <4fc009ce-d01e-1321-3bc5-beb9618bce82@aklaver.com> Date: Thu, 19 Jan 2023 14:41:22 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: en-US To: pgsql-general From: Adrian Klaver Subject: Documentation discrepancy UNIQUE NULLS NOT DISTINCT Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk From here: https://www.postgresql.org/about/featurematrix/detail/392/ UNIQUE NULLS NOT DISTINCT By default, NULL values are not treated as distinct entries. Specifying NULLS NOT DISTINCT on unique indexes / constraints will cause NULL values to be treated distinctly. From here: https://www.postgresql.org/docs/current/sql-createindex.html NULLS DISTINCT NULLS NOT DISTINCT Specifies whether for a unique index, null values should be considered distinct (not equal). The default is that they are distinct, so that a unique index could contain multiple null values in a column. and here: https://www.postgresql.org/docs/current/sql-createtable.html For the purpose of a unique constraint, null values are not considered equal, unless NULLS NOT DISTINCT is specified. -- Adrian Klaver adrian.klaver@aklaver.com