Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

contrib/docker: Ensure correct encoding and locale settings on DB creation #6921

Merged
merged 2 commits into from
Feb 14, 2020

Conversation

fridtjof
Copy link
Contributor

@fridtjof fridtjof commented Feb 14, 2020

According to the docs, these should be explicitly set. In my case, after setting up a homeserver with this compose file as a reference, I ended up with this:

synapse=# SELECT datcollate,datctype FROM pg_database WHERE datname = current_database();
 datcollate |  datctype  
------------+------------
 en_US.utf8 | en_US.utf8

Signed-off-by: Fridtjof Mund fridtjof@das-labor.org

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks sensible. Thanks!

@richvdh richvdh merged commit 32873ef into matrix-org:develop Feb 14, 2020
@fridtjof
Copy link
Contributor Author

So, after using this today, I noticed that docker-compose (in combination with the entrypoint postgres uses in that container) really does not like the quotes I used:

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
initdb: "UTF-8 --lc-collate=C --lc-ctype=C" is not a valid server encoding name

After removing the quotes, it behaved:

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locales
  COLLATE:  C
  CTYPE:    C
  MESSAGES: en_US.utf8
  MONETARY: en_US.utf8
  NUMERIC:  en_US.utf8
  TIME:     en_US.utf8
The default text search configuration will be set to "english".

[...]

I'll open another PR shortly 🤦‍♂

richvdh pushed a commit that referenced this pull request Feb 25, 2020
I made a mistake in #6921 - the quotes break the postgres container's startup script (or docker-compose), which makes initdb fail: #6921 (comment)

Signed-off-by: Fridtjof Mund <fridtjof@das-labor.org>
nim65s added a commit to nim65s/oxyta.net that referenced this pull request Apr 12, 2020
phil-flex pushed a commit to phil-flex/synapse that referenced this pull request Apr 15, 2020
I made a mistake in matrix-org#6921 - the quotes break the postgres container's startup script (or docker-compose), which makes initdb fail: matrix-org#6921 (comment)

Signed-off-by: Fridtjof Mund <fridtjof@das-labor.org>
babolivier pushed a commit that referenced this pull request Sep 1, 2021
…ation (#6921)

* commit '32873efa8':
  contrib/docker: Ensure correct encoding and locale settings on DB creation (#6921)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants