Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oFhRn-0002my-Ku for pgsql-docs@arkaria.postgresql.org; Sun, 24 Jul 2022 19:39:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oFhRm-0004jn-Fe for pgsql-docs@arkaria.postgresql.org; Sun, 24 Jul 2022 19:39:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oFhRm-0004je-7q for pgsql-docs@lists.postgresql.org; Sun, 24 Jul 2022 19:39:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oFhRj-00028G-Uc for pgsql-docs@lists.postgresql.org; Sun, 24 Jul 2022 19:39:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 26OJdHIJ1737958; Sun, 24 Jul 2022 15:39:17 -0400 From: Tom Lane To: chu_z@hotmail.com cc: pgsql-docs@lists.postgresql.org Subject: Re: Correction In-reply-to: <165844944334.271448.18067658391804504480@wrigleys.postgresql.org> References: <165844944334.271448.18067658391804504480@wrigleys.postgresql.org> Comments: In-reply-to PG Doc comments form message dated "Fri, 22 Jul 2022 00:24:03 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1737956.1658691557.1@sss.pgh.pa.us> Date: Sun, 24 Jul 2022 15:39:17 -0400 Message-ID: <1737957.1658691557@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Doc comments form writes: > "If you declare a column as UNIQUE or PRIMARY KEY, the implicitly generated > index is case-sensitive. So it's useless for case-insensitive searches, and > it won't enforce uniqueness case-insensitively." > I think the statement above is not correct. I tried creating a PK or unique > key index on a CITEXT column. It checks uniqueness in case-insensitivity. That paragraph is talking about what happens when you *don't* use citext. regards, tom lane