From 6ef472de0f1ea9fdfa9033959b6a3da1cb96bd93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Thu, 24 Aug 2023 14:36:36 +0200 Subject: [PATCH] postgres: Switch to C.UTF-8 This locale is included in glibc. Another advantage is, that this will prevent future warnings about a collation version mismatch on glibc upgrades. --- roles/postgres/tasks/main.yml | 2 +- roles/postgres/templates/postgresql.conf.j2 | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/postgres/tasks/main.yml b/roles/postgres/tasks/main.yml index 0b759f1..942e07b 100644 --- a/roles/postgres/tasks/main.yml +++ b/roles/postgres/tasks/main.yml @@ -22,7 +22,7 @@ become: true become_user: postgres ansible.builtin.command: - cmd: initdb --locale en_US.UTF-8 -E UTF-8 -D '/var/lib/postgres/data' + cmd: initdb --locale C.UTF-8 -E UTF-8 -D '/var/lib/postgres/data' chdir: /var/lib/postgres creates: /var/lib/postgres/data/postgresql.conf diff --git a/roles/postgres/templates/postgresql.conf.j2 b/roles/postgres/templates/postgresql.conf.j2 index 73f0d61..9065d95 100644 --- a/roles/postgres/templates/postgresql.conf.j2 +++ b/roles/postgres/templates/postgresql.conf.j2 @@ -707,11 +707,11 @@ timezone = 'UTC' # encoding # These settings are initialized by initdb, but they can be changed. -lc_messages = 'en_US.UTF-8' # locale for system error message +lc_messages = 'C.UTF-8' # locale for system error message # strings -lc_monetary = 'en_US.UTF-8' # locale for monetary formatting -lc_numeric = 'en_US.UTF-8' # locale for number formatting -lc_time = 'en_US.UTF-8' # locale for time formatting +lc_monetary = 'C.UTF-8' # locale for monetary formatting +lc_numeric = 'C.UTF-8' # locale for number formatting +lc_time = 'C.UTF-8' # locale for time formatting # default configuration for text search default_text_search_config = 'pg_catalog.english' -- 2.44.0