非超级用户无法在公共模式下创建表
postgres - 超级用户。
我所做的:
ALTER SCHEMA public owner to postgres;
CREATE USER admin WITH PASSWORD 'my-password';
GRANT USAGE, CREATE ON SCHEMA public TO postgres;
GRANT USAGE, CREATE ON SCHEMA public TO admin;
CREATE DATABASE mydb;
GRANT ALL ON DATABASE mydb TO admin;
权限:
postgres=# \dn+
List of schemas
Name | Owner | Access privileges | Description
--------+----------+----------------------+------------------------
public | postgres | postgres=UC/postgres+| standard public schema
| | =UC/postgres +|
| | admin=UC/postgres |
(1 row)
我得到了什么:
如何在公共模式中创建表?