pg_ctl: command not found, what package has this command?

You shouldn't run pg_ctl directly under Ubuntu/Debian. Use pg_ctlcluster instead, which is installed by postgresql-common. See its man page for documentation.


You should edit your path:

$ cd ~
$ vim .profile
PATH=$PATH:/usr/lib/postgresql/{version}/bin
export PATH
$ . ~/.profile

Replace {version} with the correct version number.

And now you can execute the command from the shell:

pg_ctl --help
pg_ctl is a utility to initialize, start, stop, or control a PostgreSQL server.

use this code:

sudo pg_ctlcluster 'cluster_version' 'cluster-name' 'action'

where:

/etc/postgresql/**cluster-version**/**cluster-name**/start.conf

where action:

start|stop|restart|reload|status|promote

example my code:

/etc/postgresql/9.5/main/pg_hba.conf

sudo pg_ctlcluster 9.5 main reload

Tags:

Postgresql