如何修改PostgreSQL数据库中所有表的所有者?
我试过,ALTER TABLE * OWNER TO new_owner但它不支持星号语法.
我有一个用户:user_x在postgresql上拥有一个数据库,并且没有任何ROLE属性,如(CREATE_DB,SUPERUSER,...)
这个user_x可以访问整个数据库,创建表(在他的数据库上),选择,插入和更新数据.
我有这个数据库列表:
mydatabase=> \l
List of databases
Name | Owner | Encoding | Collation | Ctype | Access privileges
-------------------------+----------+-----------+-----------+-------+-----------------------
postgres | postgres | SQL_ASCII | C | C |
mydatabase | user_x | UTF8 | C | C |
template0 | postgres | SQL_ASCII | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | SQL_ASCII | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
whoami | postgres …Run Code Online (Sandbox Code Playgroud)