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 1jJoHo-0005B2-QM for pgsql-bugs@arkaria.postgresql.org; Thu, 02 Apr 2020 01:04:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jJoHn-0003Sq-LZ for pgsql-bugs@arkaria.postgresql.org; Thu, 02 Apr 2020 01:04:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJoHn-0003Sj-Fe for pgsql-bugs@lists.postgresql.org; Thu, 02 Apr 2020 01:04:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJoHl-00027K-A2 for pgsql-bugs@lists.postgresql.org; Thu, 02 Apr 2020 01:04:46 +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 03214iCA012377; Wed, 1 Apr 2020 21:04:44 -0400 From: Tom Lane To: me@reynolds.tj cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16333: position() function not equivalent to strpos() function when comparing citext In-reply-to: <16333-dd25eea9d90e244d@postgresql.org> References: <16333-dd25eea9d90e244d@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Wed, 01 Apr 2020 23:26:29 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12375.1585789484.1@sss.pgh.pa.us> Date: Wed, 01 Apr 2020 21:04:44 -0400 Message-ID: <12376.1585789484@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > SELECT position('foo'::citext IN 'Foobar'::citext) = > strpos('Foobar'::citext, 'foo'::citext) as "positionEqualsStrpos"; > Citext does not create an overload for position() supporting citext > parameters, therefore position(a in b) always runs case-sensitive. Well, the citext documentation specifies which functions have case-insensitive mappings. strpos() is listed, position() is not, so I'd say it's acting precisely as documented. We could consider adding position() of course, but there's a backwards-compatibility issue --- at this point, people may have queries that depend on the current behavior. regards, tom lane