Outdated note about unique indexes

Started by Josh Kupershmidtalmost 11 years ago3 messagesdocs
Jump to latest
#1Josh Kupershmidt
schmiddy@gmail.com

Hi,

I noticed that the note on a page about unique indexes

http://www.postgresql.org/docs/current/static/indexes-unique.html

says "The preferred way to add a unique constraint to a table is ALTER
TABLE ... ADD CONSTRAINT. The use of indexes to enforce unique constraints
could be considered an implementation detail that should not be accessed
directly... ".

That note has been there forever, in particular since before we supported
CONCURRENTLY, which is pretty darn important in many uses nowadays. Since
it seems like some users have taken this suggestion seriously, e.g. on
stackoverflow[1]http://stackoverflow.com/questions/23542794/postgres-unique-constraint-vs-index, how about we remove this outdated suggestion? There is
already a previous mention a few sections earlier[2]http://www.postgresql.org/docs/current/interactive/indexes-intro.html suggesting the use of
CONCURRENTLY, so I don't think we really need to reiterate that suggestion
here.

Josh

[1]: http://stackoverflow.com/questions/23542794/postgres-unique-constraint-vs-index
http://stackoverflow.com/questions/23542794/postgres-unique-constraint-vs-index
[2]: http://www.postgresql.org/docs/current/interactive/indexes-intro.html

Attachments:

indices_constraint_suggestion.difftext/plain; charset=US-ASCII; name=indices_constraint_suggestion.diffDownload+1-5
#2Josh Berkus
josh@agliodbs.com
In reply to: Josh Kupershmidt (#1)
Re: Outdated note about unique indexes

That note has been there forever, in particular since before we
supported CONCURRENTLY, which is pretty darn important in many uses
nowadays. Since it seems like some users have taken this suggestion
seriously, e.g. on stackoverflow[1], how about we remove this outdated
suggestion? There is already a previous mention a few sections
earlier[2] suggesting the use of CONCURRENTLY, so I don't think we
really need to reiterate that suggestion here.

+1

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

#3Bruce Momjian
bruce@momjian.us
In reply to: Josh Berkus (#2)
Re: Outdated note about unique indexes

On Wed, Jul 8, 2015 at 03:10:46PM -0700, Josh Berkus wrote:

That note has been there forever, in particular since before we
supported CONCURRENTLY, which is pretty darn important in many uses
nowadays. Since it seems like some users have taken this suggestion
seriously, e.g. on stackoverflow[1], how about we remove this outdated
suggestion? There is already a previous mention a few sections
earlier[2] suggesting the use of CONCURRENTLY, so I don't think we
really need to reiterate that suggestion here.

+1

Patch applied through 9.5.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs