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 1jK7fC-0001ap-7Z for pgsql-bugs@arkaria.postgresql.org; Thu, 02 Apr 2020 21:46:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jK7fB-0006HC-27 for pgsql-bugs@arkaria.postgresql.org; Thu, 02 Apr 2020 21:46:13 +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 1jK7fA-0006H5-Rw for pgsql-bugs@lists.postgresql.org; Thu, 02 Apr 2020 21:46:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jK7f8-0007Bx-4r for pgsql-bugs@lists.postgresql.org; Thu, 02 Apr 2020 21:46:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 032Lk6ft028842; Thu, 2 Apr 2020 17:46:06 -0400 From: Tom Lane To: Peter Eisentraut cc: me@reynolds.tj, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16333: position() function not equivalent to strpos() function when comparing citext In-reply-to: <9817af55-fbe4-b342-b641-637f1308ef96@2ndquadrant.com> References: <16333-dd25eea9d90e244d@postgresql.org> <12376.1585789484@sss.pgh.pa.us> <9817af55-fbe4-b342-b641-637f1308ef96@2ndquadrant.com> Comments: In-reply-to Peter Eisentraut message dated "Thu, 02 Apr 2020 22:53:17 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28840.1585863966.1@sss.pgh.pa.us> Date: Thu, 02 Apr 2020 17:46:06 -0400 Message-ID: <28841.1585863966@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Eisentraut writes: > Arguably, there is a misdesign here, however. Any function that does > some kind of text-in-text search where citext could plausbily offer > case-insensitive behavior will automatically fall back to the > case-sensitive version if citext doesn't offer its own variant. The fix > would technically need to be that citext offers its own variant of every > potential such function, which is clearly not possible, or that casts > between text and citext are more restricted, which would make citext > nearly unusable. Indeed. There are some hundreds of built-in functions that take one or more text arguments; how many of them would need citext variants? > Doesn't seem fixable. Collations are probably a better way of dealing > with this. Yeah, now that we can do non-deterministic collations, it seems like citext is on the road to obsolescence. Do we have a documentation example of how to build a simple CI collation? regards, tom lane