Gatuno
Gatuno

Reputation: 123

Set up Postgresql-93 on Centos 7

I followed this Almost idiot's guide to install postgresql and postgis on Centos 7 and got stuck starting the database itself with the following command:

[root@localhost cmaps]# service postgresql-9.3 initdb
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.

If I install the postgresql package from Centos repository (version 9.2) the command works, but then I they don't have postgis, and there is no official posgresql-92 repository for Centos 7.

Any idea on what's happening?

Thank you!

Upvotes: 12

Views: 10785

Answers (3)

helvete
helvete

Reputation: 2673

For Centos 7.3 installed on MS Azure platform the script is located at

/usr/bin/postgresql-setup initdb

the version number is absent from the name of these as well:

  • db data & config location: /var/lib/pgsql/data/
  • service name /sbin/service postgresql status or systemctl status postgresql.service

Upvotes: 0

veradiego31
veradiego31

Reputation: 408

I had the same problem and solve it by changing the path

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

Note that the path is different

Upvotes: 21

Craig Ringer
Craig Ringer

Reputation: 324475

CentOS 7 is based on systemd. PostgreSQL packages use a different command for initdb there:

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

On older versions, call the initscript directly.

/etc/init.d/postgresql-9.3 initdb

Upvotes: 6

Related Questions