user1463822
user1463822

Reputation: 887

How to run initdb for postgresql 9.2 on centos7?

So,

My admin installed (don't know how) postgresql 9.2 (64 bit version) on a centos7 machine. The thing is I need to initalize the database so I should run something like:

service postgresql-9.2 initdb

but I get error:

The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

Did some search and people said that you should initialize via direct call to some script, but every given location does not exists in this CentOS 7 machine.

Like for example this location (yeah, it is for 9.3 and I use 9.2, but similar location does not exist anyway):

/usr/lib/pgsql-9.3/bin/postgresql93-setup initdb

or this

/usr/pgsql-9.3/bin/postgresql93-setup initdb

I found out

/usr/lib64/pgsql 

but this directory has only a bunch of '*.so' files.

How the hell do I run initdb for postgresql 9.2 on centos7?

Upvotes: 1

Views: 4881

Answers (2)

leMon
leMon

Reputation: 11

You can run it directly from postgres account

#su - postgres -c pg_ctl initdb

Upvotes: 1

Aret
Aret

Reputation: 475

Just installed the Postgresql 9.3 on Centos.

#cd /etc/init.d
#ls postgres*

and there is a posgresql-9.3 script

#./postgresql-9.3 

gives you the options to run with and one of them is initdb

Upvotes: 0

Related Questions