79559596

Date: 2025-04-07 10:20:25
Score: 0.5
Natty:
Report link

Question: where is LC_CTYPE: UTF-8 coming from?

The LC_CTYPE: UTF-8 can come from the current Postgresql 13 configurations/cluster.

For example,

admin@i-04aa762bacf0b8a27:/etc/postgresql/13/main$ sudo grep -r locale .
./postgresql.conf:lc_messages = 'C.UTF-8'                       # locale for system error message
./postgresql.conf:lc_monetary = 'C.UTF-8'                       # locale for monetary formatting
./postgresql.conf:lc_numeric = 'C.UTF-8'                        # locale for number formatting
./postgresql.conf:lc_time = 'C.UTF-8'                           # locale for time formatting

The pg_upgradecluster command has an option --locale. We can run

pg_upgradecluster --locale=en_US.UTF-8 13 main

to set the locale en_US.UTF-8 for the upgraded database cluster.

Documentation:

       --locale=locale
           Set the default locale for the upgraded database cluster. If this option is not specified, the locale
           is inherited from the old cluster.

Reference: https://manpages.ubuntu.com/manpages/trusty/man8/pg_upgradecluster.8.html

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Continuous Improvement