我在ubuntu 12.04服务器上,我正在尝试安装postgresql。截至目前,我已成功安装它但无法配置它。我需要创建一个角色来继续前进,我在终端中运行此命令:
root@hostname: createuser -s -r postgres
它说:
createuser: could not connect to database postgres: FATAL: role "root" does not exist
很好,所以我做了:
su - postgres
然后又试了一次
postgres@hostname: createuser -s -r postgres
我得到了错误
createuser: could not connect to database postgres: FATAL: role "postgres" does not exist
当我这样做时,我得到同样的错误
psql -d dbname
它像一个循环,我无法创建一个角色 postgres
因为一个角色 postgres
尚不存在。
我该如何解决 ?
postgres版本似乎是9.1.x,ubuntu版本是12.10