pgsql: Force LC_COLLATE to C in postmaster.

From: Jeff Davis <jdavis(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Force LC_COLLATE to C in postmaster.
Date: 2025-07-16 21:14:25
Message-ID: E1uc9SL-006eJ6-1l@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Force LC_COLLATE to C in postmaster.

Avoid dependence on setlocale().

strcoll(), etc., are not called directly; all collation-sensitive
calls should go through pg_locale.c and use the appropriate
provider. By setting LC_COLLATE to C, we avoid accidentally depending
on libc behavior when using a different provider.

No behavior change in the backend, but it's possible that some
extensions will be affected. Such extensions should be updated to use
the pg_locale_t APIs.

Discussion: https://postgr.es/m/9875f7f9-50f1-4b5d-86fc-ee8b03e8c162@eisentraut.org
Reviewed-by: Peter Eisentraut <peter(at)eisentraut(dot)org>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5e6e42e44fe10cab616b4fbe9725df03c987c90a

Modified Files
--------------
doc/src/sgml/catalogs.sgml | 2 +-
doc/src/sgml/charset.sgml | 2 +-
doc/src/sgml/ref/create_database.sgml | 45 ++++++++++++++++++-----------------
doc/src/sgml/ref/createdb.sgml | 3 ++-
src/backend/main/main.c | 16 ++++++++-----
src/backend/utils/init/postinit.c | 11 ++++-----
6 files changed, 42 insertions(+), 37 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-07-16 22:43:23 pgsql: doc: Add example file for COPY
Previous Message Álvaro Herrera 2025-07-16 17:23:59 pgsql: Fix dumping of comments on invalid constraints on domains