我正在尝试在AWS的Postgres中创建一个具有只读权限的用户。
CREATE USER readonly_username WITH PASSWORD 'password';
GRANT USAGE ON SCHEMA public to readonly_username;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readonly_username;
之后,我授予SELECT权限新表:
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readonly_username;
但是当我尝试向现有表授予权限时,出现错误:
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly_username;
错误:关系admin_log的权限被拒绝
有人可以帮助我吗?