Re: Add CASEFOLD() function.

From: Thom Brown <thom(at)linux(dot)com>
To: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Vik Fearing <vik(at)postgresfriends(dot)org>, Joe Conway <mail(at)joeconway(dot)com>, Ian Lawrence Barwick <barwick(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add CASEFOLD() function.
Date: 2025-06-19 18:55:43
Message-ID: CAA-aLv5rW4p=8u0C1Od36LiLes2v3225uS6fYduORhTAW7w3mg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 19 Jun 2025 at 18:39, David E. Wheeler <david(at)justatheory(dot)com> wrote:
>
> On Jun 19, 2025, at 12:59, Thom Brown <thom(at)linux(dot)com> wrote:
>
> > No. But given the options, I would personally choose nondeterministic collations now that they are available. I just wish they were more user-friendly as I suspect the majority of people either won't know about them, or won't know how to use them.
>
> I suspect there are a lot of uses of citext for databases created before nondeterministic collations existed and people are unaware of them or unclear on the migration path from one to the other, let alone implications for any infrastructure they built around cutest (like function signatures and return values). As long as citext conteinues to be maintained there and there’s no super clear path to migrate, I’d bet good money that few would bother to switch.

Maybe the citext doc page should explain how to get unhooked from it.
Something like:

ALTER TABLE mytable
ALTER COLUMN ci_column
SET DATA TYPE TEXT COLLATE case_insensitive_collation;

or

CREATE DOMAIN ci_text AS text
COLLATE case_insensitive_collation;

ALTER TABLE mytable
ALTER COLUMN ci_column
SET DATA TYPE ci_text;

And because they're binary-compatible, they should also be free. No
doubt a procedure could do this to every instance in the database,
although I guess it gets trickier when it comes to functions that
accept citext as a parameter type, and other similar examples.

Thom

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Paul Jungwirth 2025-06-19 19:09:47 Re: Correct docs about partitions and EXCLUDE constraints
Previous Message Arseniy Mukhin 2025-06-19 18:32:54 Re: amcheck support for BRIN indexes