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

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


pgsql-bugs by date:

Previous
From: Abdallah Farouk
Date:
Subject: Help to Install Postgre SQL
Next
From: Doug Johnson
Date:
Subject: Postgres Installer not Appearing When Exe Is Run