Re: BUG #16333: position() function not equivalent to strpos() function when comparing citext - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #16333: position() function not equivalent to strpos() function when comparing citext
Date
Msg-id 12376.1585789484@sss.pgh.pa.us
Whole thread Raw
In response to BUG #16333: position() function not equivalent to strpos() function when comparing citext  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #16333: position() function not equivalent to strpos()function when comparing citext
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> 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



pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #16333: position() function not equivalent to strpos()function when comparing citext
Next
From: Michael Paquier
Date:
Subject: Re: BUG #16325: Assert failure on partitioning by int for a textvalue with a collation