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!
For instance, in the last example, you were instructed to get to the Postgres prompt by first switching to the postgres user and then running psql to open the Postgres prompt. You could do this in one step by running the single command psql as the postgres user with sudo , like this: sudo -u postgres psql.
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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With