You are not logged in.

#1 2022-05-08 03:45:34

pvpmartins
Member
Registered: 2022-02-06
Posts: 46

[Solved][PostgreSQL] Error while initializing DB Cluster

Hi! I'm following the PostgreSQL installation guide by ArchWiki.

After installing packages, I just get this error after entering "initdb -D /var/lib/postgres/data" command.

This is what I got:

"initdb: error: invalid locale settings; check LANG and LC_* environment variables"


I did disabled the CoW on /var/lib/postgres directory, since I'm on a btrfs and it was advised in the article to do so.

Last edited by pvpmartins (2022-05-30 02:11:11)

Offline

#2 2022-05-08 04:12:20

pvpmartins
Member
Registered: 2022-02-06
Posts: 46

Re: [Solved][PostgreSQL] Error while initializing DB Cluster

So... When I enter "locale -a" I got this:

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
POSIX 

I went to the locale.gen file and saw that on the list it was "_US.UTF8" and I thought it should be "en_US.UTF8". So I did altered to the latter.
The error persists.

Last edited by pvpmartins (2022-05-08 04:12:38)

Offline

#3 2022-05-08 04:14:45

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved][PostgreSQL] Error while initializing DB Cluster

Did you regenerate your locales after editing the file?
https://wiki.archlinux.org/title/Locale


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2022-05-08 21:10:17

pvpmartins
Member
Registered: 2022-02-06
Posts: 46

Re: [Solved][PostgreSQL] Error while initializing DB Cluster

Thank you! Just did it and it worked!

I thought I wouldn't need to use "locale-gen" once I edited the locale.gen file.

Thank you again.

Offline

#5 2022-05-08 21:30:27

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved][PostgreSQL] Error while initializing DB Cluster

Please remember to mark the thread as [SOLVED].
CoC - How to post


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

Board footer

Powered by FluxBB