Re: Add pg_strtoupper and pg_strtolower functions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Add pg_strtoupper and pg_strtolower functions
Date
Msg-id 2336554.1651671603@sss.pgh.pa.us
Whole thread Raw
In response to Re: Add pg_strtoupper and pg_strtolower functions  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> Currently, pg_toupper/pg_tolower are used in very limited situations.
> Are they really always safe enough to run in arbitrary situations,
> enough to create this new layer on top of them?

They are not, and we should absolutely not be encouraging additional uses
of them.  The existing multi-character str_toupper/str_tolower functions
should be used instead.  (Perhaps those should be relocated to someplace
more prominent?)

> Reading the comment on
> pg_tolower, "the whole thing is a bit bogus for multibyte charsets", I
> worry that we might create security holes, either now or in future
> callsites that use these new functions.

I doubt that they are security holes, but they do give unexpected
answers in some locales.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Add a new function and a document page to get/show all the server hooks
Next
From: Peter Eisentraut
Date:
Subject: Re: [PATCH] Log details for client certificate failures