From 045825619694c289d7aefbfb5baccd03907bd335 Mon Sep 17 00:00:00 2001
From: Evangelos Foutras <evangelos@foutrelis.com>
Date: Wed, 20 Apr 2022 13:06:14 +0300
Subject: [PATCH] matrix: use C locale for the synapse database

Synapse needs the database to be in C locale. Since v1.56.0, it refuses
to start when this is not the case, see [upgrade.md][1].

[1]: https://github.com/matrix-org/synapse/blob/v1.56.0/docs/upgrade.md#change-in-behaviour-for-postgresql-databases-with-unsafe-locale
---
 roles/matrix/tasks/main.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/roles/matrix/tasks/main.yml b/roles/matrix/tasks/main.yml
index 2296383b3..28099e972 100644
--- a/roles/matrix/tasks/main.yml
+++ b/roles/matrix/tasks/main.yml
@@ -172,7 +172,7 @@
     - restart postgres
 
 - name: add synapse postgres db
-  postgresql_db: db=synapse
+  postgresql_db: db=synapse lc_collate=C lc_ctype=C template=template0
   become: true
   become_user: postgres
   become_method: su
-- 
GitLab