Hi Tom,
> Aleksander Alekseev <aleksander@timescale.com> writes:
> > The test still fails under the following conditions:
>
> > $ env | grep UTF-8
> > LANG=en_US.UTF-8
> > LC_ALL=en_US.UTF-8
> > LC_NUMERIC=ru_RU.UTF-8
>
> Hmm, so psql is honoring the LC_NUMERIC setting in that environment,
> but perl isn't. For me, it appears that adding 'use locale;' to
> the test script will fix it ... can you confirm if it's OK for you?
Right, src/bin/psql/t/001_basic.pl has "use locale;" since cd82e5c7
and it fails nevertheless.
If I set LC_NUMERIC manually:
```
LC_NUMERIC=en_US.UTF-8 meson test -C build --suite postgresql:psql
```
... the test passes. I can confirm that Perl doesn't seem to be
honoring LC_NUMERIC:
```
$ LC_ALL=en_US.UTF-8 LC_NUMERIC=en_US.UTF-8 perl -e 'use locale;
printf("%g\n", 0.01)'
0.01
$ LC_ALL=en_US.UTF-8 LC_NUMERIC=ru_RU.UTF-8 perl -e 'use locale;
printf("%g\n", 0.01)'
0.01
$ LC_ALL=ru_RU.UTF-8 LC_NUMERIC=en_US.UTF-8 perl -e 'use locale;
printf("%g\n", 0.01)'
0,01
$ LC_ALL=ru_RU.UTF-8 LC_NUMERIC=ru_RU.UTF-8 perl -e 'use locale;
printf("%g\n", 0.01)'
0,01
```
The Perl version is 5.34.0.
It is consistent with `perdoc perllocale`:
```
The initial program is started up using the locale specified from the
environment, as currently, described in "ENVIRONMENT". [...]
ENVIRONMENT
[...]
"LC_ALL" "LC_ALL" is the "override-all" locale environment variable.
If set, it overrides all the rest of the locale environment
variables.
```
So it looks like what happens is LC_ALL overwrites LC_NUMERIC for perl
but not for psql.
--
Best regards,
Aleksander Alekseev