在 Google 的 SQL Cloud Postgres 服务中,当我通过 Web 控制台为 PostgreSQL 实例创建数据库时,它会自动将数据库的默认“公共”架构的所有者设置为 cloudsqladmin。看来我无法更改所有权:
mydb=> \dn
List of schemas
Name | Owner
--------+---------------
public | cloudsqladmin
(1 row)
mydb=> alter schema public owner to postgres;
ERROR: must be owner of schema public
mydb=> \du
List of roles
Role name | Attributes | Member of
-------------------+------------------------------------------------+---------------------
cloudsqladmin | Superuser, Create role, Create DB, Replication | {}
cloudsqlagent | Create role, Create DB | {cloudsqlsuperuser}
cloudsqlreplica | Replication | {}
cloudsqlsuperuser | Create role, …Run Code Online (Sandbox Code Playgroud)