【发布时间】:2013-06-27 21:08:39
【问题描述】:
我正在尝试设置一个我可以随意创建和销毁的玩具数据库。我不想使用postgres 用户,以防我破坏了一些重要的东西。我做了以下事情:
$ psql -h localhost -U postgres
postgres=# \du
List of roles
Role name | Attributes | Member of
-----------+-----------------------------------+-----------
postgres | Superuser, Create role, Create DB | {}
postgres=# create user Stephen createdb;
CREATE ROLE
postgres=# \du
List of roles
Role name | Attributes | Member of
-----------+-----------------------------------+-----------
postgres | Superuser, Create role, Create DB | {}
stephen | Create DB | {}
postgres=# ^D\q
然后当我尝试连接时,我收到以下错误:
$ psql -h localhost
psql: FATAL: role "Stephen" does not exist
$ psql -h localhost -U Stephen
psql: FATAL: role "Stephen" does not exist
这对我来说毫无意义。我可以看到用户,斯蒂芬,但它不会让我使用它。我错过了什么?
我在 OS X Lion 上使用 psql 9.0.10。
【问题讨论】:
标签: postgresql osx-lion