Thread: BUG #18136: lc_messages is the empty string but should be 'C'?

BUG #18136: lc_messages is the empty string but should be 'C'?

From
PG Bug reporting form
Date:
The following bug has been logged on the website:

Bug reference:      18136
Logged by:          Gavin Panella
Email address:      gavinpanella@gmail.com
PostgreSQL version: 16.0
Operating system:   macOS
Description:

Given a server:

```
initdb -D foo --locale=C
pg_ctl start -D foo -l logfile -w -o "-h '' -k $PWD/foo"
```

In PostgreSQL 16.0 the value of lc_messages is the empty string.

But in PostgreSQL from 9.x through to 15.x the value of lc_messages is
'C'.

I have tried using `initdb ... --lc-messages=C` and `LC_MESSAGES=C pg_ctl
start ...` and `LC_MESSAGES=C psql ...` with the same result.

However, if I run initdb with a locale other than C, e.g. POSIX or fr_FR,
then the value of lc_messages *does* reflect my choice.

Using --lc-messages with initdb also sets lc_messages as expected.

(This is something I observed from some test suites I run, and I dug into it
to see if there was a problem. Other than needing me to update those tests,
it is not affecting me at present.)