Re: BUG #16333: position() function not equivalent to strpos() function when comparing citext

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: me(at)reynolds(dot)tj
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16333: position() function not equivalent to strpos() function when comparing citext
Date: 2020-04-02 01:04:44
Message-ID: 12376.1585789484@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2020-04-02 02:01:50 Re: BUG #16325: Assert failure on partitioning by int for a text value with a collation
Previous Message David G. Johnston 2020-04-02 01:00:17 Re: BUG #16333: position() function not equivalent to strpos() function when comparing citext