postgresql-setup --initdb fails with invalid locale error on RHEL 9
Issue
The postgresql-setup --initdb
fails with this message:
* Initializing database in '/var/lib/pgsql/data'
mkdir: cannot create directory '/var/lib/pgsql/data/log': File exists
ERROR: Initializing database failed, possibly see /var/lib/pgsql/initdb_postgresql.log
Environment
- Red Hat Enterprise Linux (RHEL) 9 Cloud Image
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.