-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing locale script for postgres:15.3-alpine3.18 #1082
Comments
I don't think the Alpine images have ever included $ docker run -it --rm --env POSTGRES_INITDB_ARGS='--locale-provider=icu --icu-locale=de-DE' --env LANG='de_DE.utf8' --env POSTGRES_PASSWORD=example postgres:15-alpine3.18
Unable to find image 'postgres:15-alpine3.18' locally
15-alpine3.18: Pulling from library/postgres
8a49fdb3b6a5: Already exists
397880efeff2: Pull complete
7981ad2d616c: Pull complete
521df6ab8516: Pull complete
46ac16d4613e: Pull complete
3c0b7c938b8a: Pull complete
230669f5a759: Pull complete
4dbd9486f09b: Pull complete
Digest: sha256:f632b07cad142a12360e5c4c084a3cf62fc95f3ee0be285647b4d3744840cade
Status: Downloaded newer image for postgres:15-alpine3.18
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 this locale configuration:
provider: icu
ICU locale: de-DE
LC_COLLATE: de_DE.utf8
LC_CTYPE: de_DE.utf8
LC_MESSAGES: de_DE.utf8
LC_MONETARY: de_DE.utf8
LC_NUMERIC: de_DE.utf8
LC_TIME: de_DE.utf8
The default database encoding has been set to "UTF8".
The default text search configuration will be set to "german".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... sh: locale: not found
2023-05-15 18:27:04.821 UTC [30] WARNING: no usable system locales were found
ok
syncing data to disk ... ok
initdb: warning: enabling "trust" authentication for local connections
initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
pg_ctl -D /var/lib/postgresql/data -l logfile start
waiting for server to start....2023-05-15 18:27:05.323 UTC [36] LOG: starting PostgreSQL 15.3 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit
2023-05-15 18:27:05.325 UTC [36] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-05-15 18:27:05.331 UTC [39] LOG: database system was shut down at 2023-05-15 18:27:05 UTC
2023-05-15 18:27:05.335 UTC [36] LOG: database system is ready to accept connections
done
server started
/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
waiting for server to shut down....2023-05-15 18:27:05.448 UTC [36] LOG: received fast shutdown request
2023-05-15 18:27:05.454 UTC [36] LOG: aborting any active transactions
2023-05-15 18:27:05.455 UTC [36] LOG: background worker "logical replication launcher" (PID 42) exited with exit code 1
2023-05-15 18:27:05.455 UTC [37] LOG: shutting down
2023-05-15 18:27:05.457 UTC [37] LOG: checkpoint starting: shutdown immediate
2023-05-15 18:27:05.468 UTC [37] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.004 s, sync=0.002 s, total=0.014 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB
2023-05-15 18:27:05.471 UTC [36] LOG: database system is shut down
done
server stopped
PostgreSQL init process complete; ready for start up.
2023-05-15 18:27:05.575 UTC [1] LOG: starting PostgreSQL 15.3 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit
2023-05-15 18:27:05.575 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2023-05-15 18:27:05.575 UTC [1] LOG: listening on IPv6 address "::", port 5432
2023-05-15 18:27:05.578 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-05-15 18:27:05.583 UTC [50] LOG: database system was shut down at 2023-05-15 18:27:05 UTC
2023-05-15 18:27:05.587 UTC [1] LOG: database system is ready to accept connections And then in another terminal: $ docker exec -it vigorous_albattani psql -U postgres
psql (15.3)
Type "help" for help.
postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | ICU Locale | Locale Provider | Access privileges
-----------+----------+----------+------------+------------+------------+-----------------+-----------------------
postgres | postgres | UTF8 | de_DE.utf8 | de_DE.utf8 | de-DE | icu |
template0 | postgres | UTF8 | de_DE.utf8 | de_DE.utf8 | de-DE | icu | =c/postgres +
| | | | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | de_DE.utf8 | de_DE.utf8 | de-DE | icu | =c/postgres +
| | | | | | | postgres=CTc/postgres
(3 rows)
|
Can't say for sure, but I can confirm on the postgres side it seems to work properly. |
Link to gliderlabs/docker-alpine#144 |
Closing since this appears to be working correctly / as intended. |
Maybe I am missing something, but it looks like sorting is still done using default "C" locale even if I set custom one. I set locale like this: environment:
POSTGRES_INITDB_ARGS: "--locale-provider=icu --icu-locale=en-AU"
LANG: en_AU.utf-8
LC_COLLATE: en_AU.utf-8
LC_CTYPE: en_AU.utf-8
LC_ALL: en_AU.utf-8 Then in logs I see same thing as mentioned above:
If I check datcollate, I see it is showing as set:
But sorting still works the same as using
I see this:
If Australian locale would be used, it should have Also if I try to explicitly use
or
Though it works if I explicitly specify To me it looks that |
See https://wiki.musl-libc.org/open-issues#Locale-limitations (it "works" but I don't know that it actually functions correctly, as you've experienced, and certainly isn't actually an officially supported platform by PostgreSQL upstream, to my knowledge) |
I'd like to initialize locale with ICU support and alpine latest.
Not sure if it's a problem, but there's a warning about missing locale script
Docker compose example:
Full log
The text was updated successfully, but these errors were encountered: