public inbox for [email protected]  
help / color / mirror / Atom feed
From: Bruce Momjian <[email protected]>
To: [email protected]
To: [email protected]
Subject: Re: uniqueness and null could benefit from a hint for dba
Date: Fri, 27 Sep 2019 12:37:47 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

On Wed, Sep  4, 2019 at 01:12:35PM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
> 
> Page: https://www.postgresql.org/docs/11/indexes-unique.html
> Description:
> 
> Sometimes it is convenient to create an unique index that considers NULL
> values equal. Designating a "zero" value for those rows might not be
> feasible, for example due to a foreign key.
> 
> The documentation currently only states that unique indexes do not consider
> NULLs equal. It might be good to offer workarounds, like indexing a coalesce
> function, if scans are not the reason for the index, but the uniqueness
> constraint.

I did write a blog entry about this:

	https://momjian.us/main/blogs/pgblog/2017.html#April_3_2017

Does that help?

-- 
  Bruce Momjian  <[email protected]>        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 +





view thread (7+ messages)  latest in thread

reply

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: uniqueness and null could benefit from a hint for dba
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox