pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: me@reynolds.tj
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16333: position() function not equivalent to strpos() function when comparing citext
Date: Wed, 01 Apr 2020 21:04:44 -0400
Message-ID: <12376.1585789484@sss.pgh.pa.us> (raw)
In-Reply-To: <16333-dd25eea9d90e244d@postgresql.org>
References: <16333-dd25eea9d90e244d@postgresql.org>

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





view thread (6+ messages)  latest in thread

Message-ID: <12376.1585789484@sss.pgh.pa.us>
Permalink:  ../12376.1585789484@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12376.1585789484@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, 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: <12376.1585789484@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox