我发现我在 Ubuntu 10.04 上有两个旧 PostgreSQL 安装的残骸:
$ pg_lsclustersVersion Cluster Port Status Owner Data directory Log file
Use of uninitialized value in printf at /usr/bin/pg_lsclusters line 38.
8.4 main 5432 down /var/lib/postgresql/8.4/main /var/log/postgresql/postgresql-8.4-main.log
Use of uninitialized value in printf at /usr/bin/pg_lsclusters line 38.
9.1 main 5433 down /var/lib/postgresql/9.1/main /var/log/postgresql/postgresql-9.1-main.log
$
尝试执行基本功能会返回错误,例如:
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"?
当我尝试启动数据库服务器时,会出现更多信息:
$ sudo /etc/init.d/postgresql start
* Starting PostgreSQL 9.1 database server
* Error: The cluster is owned by user id 109 which does not exist any more
...fail!
$
我的问题:如何完全删除两个集群并设置一个新集群?postgresql
我已经按照以下建议尝试删除、清除和重新安装: https ://stackoverflow.com/a/2748644/621762 。现在pg_lsclusters
显示不存在集群,但是No such file or directory
当我尝试或运行createuser
时错误仍然存在。我做错了什么?createdb
psql