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

Solution 1:

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.

Solution 2:

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.