A place to breathe

Wednesday, December 21, 2016

Installing Postgres on Red Hat

By default, Red Hat installs Postgres. But surprisingly, the Postgres cannot be started by default. I guess it's not Red Hat's issue, but it's Postgres install issue. 

Here's the fix for all you care: 

1. create the data folder: 
    sudo mkdir -p /var/lib/pgsql/data
2. change ownership of the folder to user postgres
    sudo chown postgres /var/lib/pgsql/data
3. logon to user postgres: 
    sudo -i -u postgres
4. create the db: 
    initdb -D '/var/lib/pgsql/data'
5. start the db! 
    sudo service postgresql start

You're welcome. 

About Me

I'm currently a software engineer. My specific interest is games and networking. I'm running software company called Nusantara Software.