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

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: me(at)reynolds(dot)tj
Subject: BUG #16333: position() function not equivalent to strpos() function when comparing citext
Date: 2020-04-01 23:26:29
Message-ID: 16333-dd25eea9d90e244d@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16333
Logged by: Tyler Reynolds
Email address: me(at)reynolds(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Doug Johnson 2020-04-02 00:51:32 Postgres Installer not Appearing When Exe Is Run
Previous Message Abdallah Farouk 2020-04-01 21:44:48 Help to Install Postgre SQL