我尝试使用this guide在我的VPS服务器上安装postgresql数据库。
在那里说
sudo apt-get install postgresql postgresql-contrib libpq-dev
然后
sudo su - postgres
createuser --pwprompt
exit
当我运行createuser --pwprompt
时,它会要求我创建一个密码,一旦我填写它,我会收到以下错误:
createuser: could not connect to database postgres: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
如果我psql --version
,我会psql (PostgreSQL) 9.4beta3
which psql
输出/usr/bin/psql
有关如何解决此问题的想法吗?
更新
正在运行pg_ctl
会出现另一个错误
WARNING:root:could not open file '/etc/apt/sources.list.d/passenger.list'
The program 'pg_ctl' is currently not installed. To run 'pg_ctl' please ask your administrator to install the package 'postgres-xc'
Althgough阅读postgres-xc
显示了很多其他问题。