PostgreSQL service initdb doesn’t work

databasepostgresql

I installed PostgreSQL 9.1.2 on my fedora 16 in a method similar to mentioned here, and tested it, which means that my installation is working fine.

But when I do: service postgresql initdb or even service postgresql-9.0 initdb I get the error:

Redirecting to /bin/systemctl  initdb postgresql.service
Unknown operation initdb

And because of this, I am unable to start pgAdmin3 too.

What am I missing?

Best Answer

On systems where postgres has been converted to use a native systemd unit you need to use postgresql-setup for things like initdb. So what you want is:

postgresql-setup initdb