Re: uniqueness and null could benefit from a hint for dba

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tuomas Leikola <tuomas(dot)leikola(at)gmail(dot)com>
Cc: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: uniqueness and null could benefit from a hint for dba
Date: 2019-11-05 17:13:06
Message-ID: 20191105171306.GA5839@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Tue, Oct 29, 2019 at 02:00:38PM +0200, Tuomas Leikola wrote:
> On Thu, Oct 24, 2019 at 5:31 PM Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>
> Uh, I am wondering if it is just too details for our docs.  Can you
> think of some text and its location?
>
>
>
> "Unique indexes on functions can be used to create special types of
> constraints, like considering unique values equal (coalesce) or only allowing a
> single unique integer value of a float column (floor). A filtered unique index
> only enforces uniqueness on the subset of rows that match the filter."
>
> I guess this would append to the paragraph "When an index is declared unique,
> multiple table rows with equal indexed values are not allowed. Null values are
> not considered equal. A multicolumn unique index will only reject cases where
> all indexed columns are equal in multiple rows.". Links to the mentioned
> keywords and concepts would of course be helpful, but not strictly necessary.
>
> I also thought of mentioning the caveat of (un)scannability of function or
> filtered indexes but maybe that is a bit much.

I have reviewed our documentation and found approrpiate places to
mention your floor() example, and my IS NULL example. Patch attached.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +

Attachment Content-Type Size
unique.diff text/x-diff 1.5 KB

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2019-11-05 20:02:51 Re: Instead of using the bloom index, a parallel sequencial scan is used with this example
Previous Message Bruce Momjian 2019-11-05 15:21:38 Re: wal_sender_timeout / wal_receiver_timeout - seconds or milliseconds?