【发布时间】:2012-08-06 04:00:53
【问题描述】:
我发现我在 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 显示不存在集群,但是当我尝试createuser、createdb 或运行psql 时,No such file or directory 错误仍然存在。我做错了什么?
【问题讨论】:
-
听起来您正在尝试使用来自 backports.org 的 PostgreSQL 9.1 构建,因为 Ubuntu 10.04 没有 PostgreSQL 9.1。对吗?
-
@CraigRinger:我使用了 ppa.launchpad.net/pitti/postgresql/ubuntu 的软件包。
标签: postgresql ubuntu purge