I inherited a Ubuntu desktop from another employee and installed PostgreSQL with the help of the official guide.
abc@lenovo:~$ sudo apt install postgresql-15 I had not known that I had to setup an account first so when I tried to create a database I got an error. I now know how to create a user and that is not the question.
abc@lenovo:~$ createdb createdb: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: 치명적오류: "abc" 롤(role) 없음 Notice how a small portion of the error is in a foreign language. To ensure everything is in English going forward, I edited all locales listed in /etc/default/locale to be en_US.UTF-8.
abc@lenovo:~$ sudo vim /etc/default/locale abc@lenovo:~$ cat /etc/default/locale LANG=en_US.UTF-8 LC_NUMERIC=en_US.UTF-8 LC_TIME=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=en_US.UTF-8 LC_ADDRESS=en_US.UTF-8 LC_TELEPHONE=en_US.UTF-8 LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LANGUAGE=en Then I rebooted my system. However the message that PostgreSQL generates still contained foreign language. Assuming that it simply did not apply the locale changes, I uninstalled then reinstalled the package.
abc@lenovo:~$ sudo apt remove postgresql-15 abc@lenovo:~$ sudo apt install postgresql-15 Then I checked PostgreSQL's own settings.
abc@lenovo:~$ grep lc_ /etc/postgresql/15/main/postgresql.conf lc_messages = 'en_US.UTF-8' # locale for system error message lc_monetary = 'en_US.UTF-8' # locale for monetary formatting lc_numeric = 'en_US.UTF-8' # locale for number formatting lc_time = 'en_US.UTF-8' # locale for time formatting It correctly inherited the new default locale settings from the system. However the error message had not changed a bit.
abc@lenovo:~$ createdb createdb: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: 치명적오류: "abc" 롤(role) 없음 Did I miss a locale setting? Do I need to manually wipe some cache stored deep inside? Why is the error message nevertheless mixed?
psqlcommand have its own set of config files, such as~/.psqlrc, where the language/locale is being set? The 'FILES' section ofman psqlmay give the exact path names to the server-wide and per-user files.apt removedoesn't necessarily get rid of config. Note down the numerical UID of the postgres user. Do anapt purge. Do asudo find / -uid <ID>, check that the files indeed belong(ed) to postgres and then repeat the find w/ a-deletetacked on ... Try again.