upleveled / system-setup

Set up a PERN development environment on Windows, macOS and Linux
28 stars 19 forks source link

Fix native language support issue with PostgreSQL 15 on macOS #47

Closed ProchaLu closed 4 weeks ago

ProchaLu commented 10 months ago

When running postgres on macOS, it can happen that the PostgreSQL server throws an error postmaster became multithreaded during startup with the hint Set the LC_ALL environment variable to a valid locale if the locale variables are not set.

mariavalencia@Henrietta ~ % postgres
2023-08-29 19:06:29.441 CEST [89361] LOG: starting PostgreSQL 15.4 (Homebrew) on aarch64-apple-darwin22.4.0, compiled by Apple clang version 14.0.3 (clang-1403.0.22.14.1), 64-bit
2023-08-29 19:06:29.442 CEST [89361] LOG: listening on IPv4 address "127.0.0.1", port 5432
2023-08-29 19:06:29.442 CEST [89361] LOG: listening on IPv6 address "::1", port 5432
2023-08-29 19:06:29.442 CEST [89361] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
2023-08-29 19:06:29.445 CEST [89361] FATAL: postmaster became multithreaded during startup
2023-08-29 19:06:29.445 CEST [89361] HINT: Set the LC_ALL environment variable to a valid locale.
2023-08-29 19:06:29.445 CEST [89361] LOG: database system is shut down

To fix this issue, you can set the default locale variable in .zshrc

ProchaLu commented 10 months ago

Issue fixed in commit https://github.com/upleveled/system-setup/commit/21a1cd8f14358b884e9fa3c31e8526efd4eedf92

karlhorky commented 1 month ago

A student just reported that this is not fixed yet on macOS, reopening:

x@Xs-MBP ~ % postgres
2024-08-01 11:32:33.536 CEST [14060] LOG: starting PostgreSQL 16.3 (Homebrew) on aarch64-apple-darwin23.4.0, compiled by Apple clang version 15.0.0 (clang-1500.3.9.4), 64-bit
2024-08-01 11:32:33.537 CEST [14060] LOG: listening on IPv6 address "::1", port 5432
2024-08-01 11:32:33.537 CEST [14060] LOG: listening on IPV4 address "127.0.0.1", port 5432
2024-08-01 11:32:33.538 CEST [14060] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
2024-08-01 11:32:33.539 CEST [14060] FATAL: postmaster became multithreaded during startup
2024-08-01 11:32:33.539 CEST [14060] HINT: Set the LC_ALL environment variable to a valid locale.
2024-08-01 11:32:33.539 CEST [14060] LOG: database system is shut down
x@Xs-MBP ~ %

This may be related to the new changes we made in @Eprince-hub's PR: