Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZCxL0-0001Am-Ps for pgsql-docs@arkaria.postgresql.org; Wed, 08 Jul 2015 21:57:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZCxKz-0007WD-Ju for pgsql-docs@arkaria.postgresql.org; Wed, 08 Jul 2015 21:57:05 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZCxKX-00079w-QH for pgsql-docs@postgresql.org; Wed, 08 Jul 2015 21:56:37 +0000 Received: from mail-qk0-x22c.google.com ([2607:f8b0:400d:c09::22c]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZCxKQ-0007l9-5o for pgsql-docs@postgresql.org; Wed, 08 Jul 2015 21:56:36 +0000 Received: by qkbp125 with SMTP id p125so173585773qkb.2 for ; Wed, 08 Jul 2015 14:56:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=Yqm8bx5GtRYn9BSIuOp6A1SgfrhG3miE4OszQSz9Vh4=; b=phgiaCUrHI0idxSIh3fz55uW4g8Eom3JICFCikhUu8+uaK0yVlU8NUZQekuP5jKhGn yG25k2/T2LAy3I6KvN9L2c8EKwmAEBhRk+FISJhTc+g6s4hXDpoCuO1KV0qhz/XuNiAw NyV7/ldmtD5yVtzuqSGoQxguwlcQFZUJdqiGWcRZvySDHrJojlKjCPQjOCNrM+3lMIsk iShFwfBCUGQ38pfU5WKTmwSgxWDtdJ0u9UMKZS9XWlr6th5csVTzYckODaDdZWc+0Ui5 6AsToWC1FxQBJmQODJhVMm1B3juoCA+huu8Lp7Ugx3zXnuivI+ojxUCzsIe3Ehic2ZE9 6NCg== X-Received: by 10.55.18.82 with SMTP id c79mr19890792qkh.18.1436392589058; Wed, 08 Jul 2015 14:56:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.22.170 with HTTP; Wed, 8 Jul 2015 14:56:09 -0700 (PDT) From: Josh Kupershmidt Date: Wed, 8 Jul 2015 17:56:09 -0400 Message-ID: Subject: Outdated note about unique indexes To: pgsql-docs Content-Type: multipart/mixed; boundary=001a113ad65a08d1b9051a6436c4 X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org --001a113ad65a08d1b9051a6436c4 Content-Type: multipart/alternative; boundary=001a113ad65a08d1b3051a6436c2 --001a113ad65a08d1b3051a6436c2 Content-Type: text/plain; charset=UTF-8 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], 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. Josh [1] http://stackoverflow.com/questions/23542794/postgres-unique-constraint-vs-index [2] http://www.postgresql.org/docs/current/interactive/indexes-intro.html --001a113ad65a08d1b3051a6436c2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I noticed that the note on a page a= bout unique indexes


say= s "The preferred way to add a unique constraint to a table is ALTER TA= BLE ... ADD CONSTRAINT. The use of indexes to enforce unique constraints co= uld be considered an implementation detail that should not be accessed dire= ctly... ".

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 th= is outdated suggestion? There is already a previous mention a few sections = earlier[2] suggesting the use of CONCURRENTLY, so I don't think we real= ly need to reiterate that suggestion here.

--001a113ad65a08d1b3051a6436c2-- --001a113ad65a08d1b9051a6436c4 Content-Type: text/plain; charset=US-ASCII; name="indices_constraint_suggestion.diff" Content-Disposition: attachment; filename="indices_constraint_suggestion.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_ibvb14q80 ZGlmZiAtLWdpdCBhL2RvYy9zcmMvc2dtbC9pbmRpY2VzLnNnbWwgYi9kb2Mv c3JjL3NnbWwvaW5kaWNlcy5zZ21sCmluZGV4IDMwOWZkMTIuLjJkMTMxYzkg MTAwNjQ0Ci0tLSBhL2RvYy9zcmMvc2dtbC9pbmRpY2VzLnNnbWwKKysrIGIv ZG9jL3NyYy9zZ21sL2luZGljZXMuc2dtbApAQCAtNjU1LDExICs2NTUsNyBA QCBDUkVBVEUgVU5JUVVFIElOREVYIDxyZXBsYWNlYWJsZT5uYW1lPC9yZXBs YWNlYWJsZT4gT04gPHJlcGxhY2VhYmxlPnRhYmxlPC9yZXBsYQogCiAgIDxu b3RlPgogICAgPHBhcmE+Ci0gICAgVGhlIHByZWZlcnJlZCB3YXkgdG8gYWRk IGEgdW5pcXVlIGNvbnN0cmFpbnQgdG8gYSB0YWJsZSBpcwotICAgIDxsaXRl cmFsPkFMVEVSIFRBQkxFIC4uLiBBREQgQ09OU1RSQUlOVDwvbGl0ZXJhbD4u ICBUaGUgdXNlIG9mCi0gICAgaW5kZXhlcyB0byBlbmZvcmNlIHVuaXF1ZSBj b25zdHJhaW50cyBjb3VsZCBiZSBjb25zaWRlcmVkIGFuCi0gICAgaW1wbGVt ZW50YXRpb24gZGV0YWlsIHRoYXQgc2hvdWxkIG5vdCBiZSBhY2Nlc3NlZCBk aXJlY3RseS4KLSAgICBPbmUgc2hvdWxkLCBob3dldmVyLCBiZSBhd2FyZSB0 aGF0IHRoZXJlJ3Mgbm8gbmVlZCB0byBtYW51YWxseQorICAgIFRoZXJlJ3Mg bm8gbmVlZCB0byBtYW51YWxseQogICAgIGNyZWF0ZSBpbmRleGVzIG9uIHVu aXF1ZSBjb2x1bW5zOyBkb2luZyBzbyB3b3VsZCBqdXN0IGR1cGxpY2F0ZQog ICAgIHRoZSBhdXRvbWF0aWNhbGx5LWNyZWF0ZWQgaW5kZXguCiAgICA8L3Bh cmE+Cg== --001a113ad65a08d1b9051a6436c4 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs --001a113ad65a08d1b9051a6436c4--