pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: me@reynolds.tj
Subject: BUG #16333: position() function not equivalent to strpos() function when comparing citext
Date: Wed, 01 Apr 2020 23:26:29 +0000
Message-ID: <16333-dd25eea9d90e244d@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      16333
Logged by:          Tyler Reynolds
Email address:      me@reynolds.tj
PostgreSQL version: 9.6.17
Operating system:   Windows 10
Description:        

To reproduce:

CREATE DATABASE test;
CREATE EXTENSION citext;

SELECT position('foo'::citext IN 'Foobar'::citext) =
strpos('Foobar'::citext, 'foo'::citext) as "positionEqualsStrpos";

Expected: "positionEqualsStrpos" returns TRUE.
Actual: "positionEqualsStrpos" returns FALSE.

Citext does not create an overload for position() supporting citext
parameters, therefore position(a in b) always runs case-sensitive.



view thread (6+ messages)  latest in thread

Message-ID: <16333-dd25eea9d90e244d@postgresql.org>
Permalink:  ../16333-dd25eea9d90e244d@postgresql.org/
Also on:    postgresql.org/message-id/16333-dd25eea9d90e244d@postgresql.org

 · 

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: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, me@reynolds.tj
  Subject: Re: BUG #16333: position() function not equivalent to strpos() function when comparing citext
  In-Reply-To: <16333-dd25eea9d90e244d@postgresql.org>

* 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