Nulls Not Distinct in Unique Indexes secton

From: Kirk Parker <khp(at)equatoria(dot)us>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Nulls Not Distinct in Unique Indexes secton
Date: 2023-03-14 15:24:25
Message-ID: CANwZ8r=hCu6=w=JRER27t9DMwvVngD55DmkU+NX_AZSfkm1KNg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

The Unique Indexes section (
https://www.postgresql.org/docs/15/indexes-unique.html) does not mention
the new NULLS [ NOT ] DISTINCT capability of indexes (
https://www.postgresql.org/docs/15/sql-createindex.html) and it probably
should.

Specifically, it has the exact wording from previous versions (emphasis
added):

When an index is declared unique, multiple table
rows with equal indexed values are not allowed.
*Null values are not considered equal*.

We should consider adding "unless the NULLS NOT DISTINCT clause is used
when creating the index", or something to that effect.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Laurenz Albe 2023-03-16 19:48:58 Re: Nulls Not Distinct in Unique Indexes secton
Previous Message Daniel Gustafsson 2023-03-14 13:44:19 Re: The use "Postgres" in docs