为1个指定的数据库重新设置所有权

paw*_*wel 11 postgresql

我想使用更改一个特定数据库中所有表的所有者

REASSIGN OWNED BY postgres TO myuser
Run Code Online (Sandbox Code Playgroud)

但它显示:

ERROR:  cannot reassign ownership of objects owned by role postgres because they are required by the database system
Run Code Online (Sandbox Code Playgroud)

我认为这是因为这个系统中有更多的数据库,但我想只在一个指定的数据库(database1)中重新分配所有者.

有办法吗?

Pet*_*aut 9

由于postgres用户拥有系统目录,因此无法重新分配所拥有的所有对象postgres.在这种情况下,您将不得不手动解决这种情况.将来,请避免使用postgres非管理任务.