From: Adrian Klaver <adrian.klaver@aklaver.com>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Documentation discrepancy UNIQUE NULLS NOT DISTINCT
Date: Thu, 19 Jan 2023 14:41:22 -0800
Message-ID: <4fc009ce-d01e-1321-3bc5-beb9618bce82@aklaver.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com
Subject: Re: Documentation discrepancy UNIQUE NULLS NOT DISTINCT
In-Reply-To: <4fc009ce-d01e-1321-3bc5-beb9618bce82@aklaver.com>
References: <4fc009ce-d01e-1321-3bc5-beb9618bce82@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox