Browse Source

Add Alpine locale information for Postgres 15 (#2220)

wglambert 3 years ago
parent
commit
2aad0d4f0d
1 changed files with 7 additions and 1 deletions
  1. 7 1
      postgres/content.md

+ 7 - 1
postgres/content.md

@@ -180,7 +180,13 @@ ENV LANG de_DE.utf8
 
 
 Since database initialization only happens on container startup, this allows us to set the language before it is created.
 Since database initialization only happens on container startup, this allows us to set the language before it is created.
 
 
-Also of note, Alpine-based variants do *not* support locales; see ["Character sets and locale" in the musl documentation](https://wiki.musl-libc.org/functional-differences-from-glibc.html#Character-sets-and-locale) for more details.
+Also of note, Alpine-based variants starting with Postgres 15 support [ICU locales](https://www.postgresql.org/docs/15/locale.html#id-1.6.11.3.7). Previous Postgres versions based on alpine do *not* support locales; see ["Character sets and locale" in the musl documentation](https://wiki.musl-libc.org/functional-differences-from-glibc.html#Character-sets-and-locale) for more details.
+
+You can set locales in the Alpine-based images with `POSTGRES_INITDB_ARGS` to set a different locale. The following example will set the default locale for a newly initialized database to `de_DE.utf8`:
+
+```console
+$ docker run -d -e LANG=de_DE.utf8 -e POSTGRES_INITDB_ARGS="--locale-provider=icu --icu-locale=de-DE" -e POSTGRES_PASSWORD=mysecretpassword %%IMAGE%%:15-alpine 
+```
 
 
 ## Additional Extensions
 ## Additional Extensions