我使用以下命令创建了只读用户
CREATE ROLE read_only WITH LOGIN PASSWORD 'password'
NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION VALID UNTIL
'infinity';
然后我选择了选择
GRANT USAGE ON SCHEMA public TO read_only;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO read_only;
GRANT SELECT ON ALL TABLES IN SCHEMA public to read_only;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO
read_only;
我的要求是,每当添加新架构时,它都应继承只读用户的权限。目前,我为新架构手动分配了这些权限。
答案 0 :(得分:1)
无法自动执行此操作,您将必须继续明确执行此操作。