【发布时间】:2018-10-31 23:58:08
【问题描述】:
我想删除一个用户,我收到了这条消息。
postgres=# drop user user1;
ERROR: role "user1" cannot be dropped because some objects depend on it
DETAIL: owner of schema schema1
postgres=#
所以,我尝试删除架构并收到以下消息:
postgres=# drop schema schema1 cascade;
ERROR: schema "schema1" does not exist
但是,架构存在!
postgres=# \dn
List of schemas
Name | Owner
---------------+----------
schema1 | user1
public | postgres
(2 rows)
【问题讨论】:
-
您是否使用同一用户运行以上所有操作?..
-
用户、数据库和架构是使用
sudo -u postgres psql -f ddl.sql创建的。 -
否 - 未创建。您发布的代码 - 都使用 postgres 用户运行?..
-
是的。我试过
\c db user1并收到“对等身份验证失败”消息。我将hba.conf文件的方法值更改为md5但是,我无法让它工作。
标签: postgresql database-design schema