【以下的问题经过翻译处理】
当我们将 RDS PostgreSQL实例版本从10.6迁移到11.1后, 出现一个问题:
包括master在内的所有 Postgres role都无法访问public schema中的对象。
select * from public.spatial_ref_sys;
出现错误 42501 ERROR: permission denied for schema public
以 master 身份执行以下查询,显示创建和使用权限为 false:
WITH "names"("name") AS (
SELECT n.nspname AS "name"
FROM pg_catalog.pg_namespace n
WHERE n.nspname = 'public'
) SELECT "name",
pg_catalog.has_schema_privilege(current_user, "name", 'CREATE') AS "create",
pg_catalog.has_schema_privilege(current_user, "name", 'USAGE') AS "usage"
FROM "names";
测试以下语句
GRANT ALL ON DATABASE dwh TO master;
可以执行,无报错. 但是执行以下语句
GRANT ALL ON SCHEMA public TO master;
会报Permission Denied错误.
如何解决这个问题?