我对 Postgress 安全主题很陌生。我使用以下命令创建用户。
CREATE USER myuser WITH PASSWORD 'PASSWORD';
GRANT CONNECT ON DATABASE "MyDB" TO myuser;
GRANT ALL PRIVILEGES ON DATABASE "MyDB" TO myuser;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO myuser;
紧接着我想删除这个用户,因为我收到了一个类似的错误:
ERROR: role "tempuser" cannot be dropped because some objects depend on it
DETAIL:
privileges for view myView
privileges for table myTable
... [rest of views and tables]
这让我有点害怕。如何在不影响数据库中的数据和其他对象的情况下安全地删除用户?