Re: Nulls Not Distinct in Unique Indexes secton

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Kirk Parker <khp(at)equatoria(dot)us>, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Nulls Not Distinct in Unique Indexes secton
Date: 2023-03-16 19:48:58
Message-ID: 6f76cd51846f0a8f02df91cc252a7ebcf8c6186f.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Tue, 2023-03-14 at 08:24 -0700, Kirk Parker wrote:
> 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.

+1

Here is a patch for that.

Yours,
Laurenz Albe

Attachment Content-Type Size
0001-Mention-NULLS-NOT-DISTINCT-in-the-SQL-documentation.patch text/x-patch 1.2 KB

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message PG Doc comments form 2023-03-17 16:56:52 bytea documentation error
Previous Message Kirk Parker 2023-03-14 15:24:25 Nulls Not Distinct in Unique Indexes secton