无法使用命令'postgres'或'pg_ctl'

Hel*_*lad 7 postgresql installation

我在Unix上.我安装了postgresql-9.3.
当我想使用pg_ctl或启动服务器时postgres,终端给我:

The program 'postgres' is currently not installed. You can install it by typing:
sudo apt-get install postgres-xc

没有这个postgres-xc,我不能启动服务器吗?

Erw*_*ter 4

这必须是postgres-xc您之前安装的软件包的残余部分。

由于您刚刚安装postgresql-9.3并且似乎没有使用任何数据库,因此我建议完全清除所有 postgres 软件包。

sudo apt-get purge postgresql-9.2
sudo apt-get purge postgresql-xc
...
Run Code Online (Sandbox Code Playgroud)

直到什么都没有了:

dpkg -l | grep postgres
Run Code Online (Sandbox Code Playgroud)

然后从头开始。您的实例pg_ctl似乎属于该包postgres-xc。卸载该软件包后,该信息应该会消失。使用以下命令之一查找:

dpkg -S pg_ctl
dlocate pg_ctl
apt-file search pg_ctl
Run Code Online (Sandbox Code Playgroud)

pg_ctlcluster由包提供postgresql-common
pg_ctl由包提供postgresql-9.3

手册中有关启动 Postgres 的更多信息。