pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <jdavis@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: downcase_identifier(): use method table from locale provider.
Date: Tue, 16 Dec 2025 23:42:40 +0000
Message-ID: <E1vVegh-0019Bu-0g@gemulon.postgresql.org> (raw)

downcase_identifier(): use method table from locale provider.

Previously, libc's tolower() was always used for lowercasing
identifiers, regardless of the database locale (though only characters
beyond 127 in single-byte encodings were affected). Refactor to allow
each provider to supply its own implementation of identifier
downcasing.

For historical compatibility, when using a single-byte encoding, ICU
still relies on tolower().

One minor behavior change is that, before the database default locale
is initialized, it uses ASCII semantics to downcase the
identifiers. Previously, it would use the postmaster's LC_CTYPE
setting from the environment. While that could have some effect during
GUC processing, for example, it would have been fragile to rely on the
environment setting anyway. (Also, it only matters when the encoding
is single-byte.)

Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/450ceb6260cad30d7afdf155d991a9caafee7c0d.camel@j-davis.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/87b2968df0f866aaccb6ba69adf284e3c4a79454

Modified Files
--------------
src/backend/parser/scansup.c              | 36 +++++++++++--------------------
src/backend/utils/adt/pg_locale.c         | 20 +++++++++++++++++
src/backend/utils/adt/pg_locale_builtin.c |  2 ++
src/backend/utils/adt/pg_locale_icu.c     | 36 ++++++++++++++++++++++++++++++-
src/backend/utils/adt/pg_locale_libc.c    | 33 ++++++++++++++++++++++++++++
src/include/utils/pg_locale.h             |  5 +++++
6 files changed, 107 insertions(+), 25 deletions(-)



Message-ID: <E1vVegh-0019Bu-0g@gemulon.postgresql.org>
Permalink:  ../E1vVegh-0019Bu-0g@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vVegh-0019Bu-0g@gemulon.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-committers@postgresql.org
  Cc: jdavis@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: downcase_identifier(): use method table from locale provider.
  In-Reply-To: <E1vVegh-0019Bu-0g@gemulon.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