Documentation discrepancy UNIQUE NULLS NOT DISTINCT

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Documentation discrepancy UNIQUE NULLS NOT DISTINCT
Date: 2023-01-19 22:41:22
Message-ID: 4fc009ce-d01e-1321-3bc5-beb9618bce82@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(dot)klaver(at)aklaver(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2023-01-19 22:51:04 Re: Documentation discrepancy UNIQUE NULLS NOT DISTINCT
Previous Message Zheng Li 2023-01-19 17:54:38 Re: Support logical replication of DDLs