postgresql-setup --initdb fails with invalid locale error on RHEL 9

Solution In Progress - Updated -


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


  • 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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content