PostgreSQL DROP ROLE抛出错误:cannot DROP ROLE,因为这是数据库系统所要求的



我有一个名为service-synapse-postgres的角色,我想在它上面运行DROP ROLE "service-synapse-postgres";。我尝试了以下命令:

synapse=# REASSIGN OWNED BY "service-synapse-postgres" TO synapse;
ERROR:  cannot reassign ownership of objects owned by role service-synapse-postgres because they are required by the database system
synapse=# DROP OWNED BY "service-synapse-postgres";
ERROR:  cannot drop objects owned by role service-synapse-postgres because they are required by the database system
synapse=# DROP ROLE "service-synapse-postgres";
ERROR:  cannot drop role service-synapse-postgres because it is required by the database system

角色service-synapse-postgres的状态:

du
List of roles
Role name         |       Attributes        | Member of
---------------------------+-------------------------+-----------
service-synapse-postgres  | Replication, Bypass RLS | {}

我能做什么?

不能删除" service-synapse- postgresql ";因为它看起来是引导用户(由initdb创建的用户),它是永久的。

你能做的最好的可能是放弃用户突触,然后创建另一个超级用户帐户,并使用它来做alter user "service-synapse-postgres" rename to synapse;

最新更新