pg_ctl: command not found

Hi,

If you can not reach pg_ctl command in bash also you are sure this command exists in your server, check $PATH.


-bash-4.2$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin

So, the directory of pg_ctl is not seem in PATH. Input directory of pg_ctl and check it then run it.

-bash-4.2$ export PATH=$PATH:/usr/pgsql-9.6/bin/pg_ctl

-bash-4.2$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/pgsql-9.6/bin/pg_ctl

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

Usage:
  pg_ctl init[db]               [-D DATADIR] [-s] [-o "OPTIONS"]
  pg_ctl start   [-w] [-t SECS] [-D DATADIR] [-s] [-l FILENAME] [-o "OPTIONS"]
  pg_ctl stop    [-W] [-t SECS] [-D DATADIR] [-s] [-m SHUTDOWN-MODE]
  pg_ctl restart [-w] [-t SECS] [-D DATADIR] [-s] [-m SHUTDOWN-MODE]
                 [-o "OPTIONS"]
  pg_ctl reload  [-D DATADIR] [-s]
  pg_ctl status  [-D DATADIR]
  pg_ctl promote [-D DATADIR] [-s]
  pg_ctl kill    SIGNALNAME PID

....
....

Loves,

Comments

Popular posts from this blog

PostgreSQL Foreign Data Wrappers

PostgreSQL High Availability - Patroni 2