无服务器Aurora Postgres特权管理

时间:2019-08-15 07:33:50

标签: postgresql amazon-rds-aurora

在AWS上具有无服务器Aurora Postgres服务,并尝试通过SQL查询在数据库和与其关联的用户中创建新架构。

使用管理员凭据连接并发出以下SQL查询将获得成功结果而不会出现错误:

CREATE USER "qqqq";
GRANT "qqqq" TO CURRENT_USER;
ALTER USER "qqqq" PASSWORD 'qqqq';
CREATE SCHEMA "qqqq" AUTHORIZATION "qqqq";
CREATE TABLE "qqqq"."super_table"( "id" INT )  -- Table just for example
GRANT USAGE ON SCHEMA "qqqq" TO "qqqq";
GRANT ALL ON SCHEMA "qqqq" TO "qqqq";
GRANT ALL ON ALL TABLES IN SCHEMA "qqqq" TO "qqqq";
GRANT ALL ON ALL SEQUENCES IN SCHEMA "qqqq" TO "qqqq";
GRANT ALL ON ALL FUNCTIONS IN SCHEMA "qqqq" TO "qqqq";
GRANT ALL PRIVILEGES ON TABLE "qqqq"."super_table" TO "qqqq";
GRANT ALL PRIVILEGES ON SCHEMA "qqqq" TO "qqqq";
GRANT SELECT ON ALL TABLES IN SCHEMA "qqqq" TO "qqqq";
GRANT SELECT ON ALL SEQUENCES IN SCHEMA "qqqq" TO "qqqq";
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA "qqqq" TO "qqqq";

不幸的是,随后与qqqq凭据的连接在Aurora无服务器上因以下错误而崩溃:

ERROR:  permission denied for schema qqqq at character 46

似乎{/ {1}}用户已经为用户/角色qqqq授予了所有必要的特权,但是仍然无法访问架构。
另外,提到的SQL查询在Postgres 10的本地安装上效果很好,并且新创建的用户admin具有足够的特权来使用qqqq模式。

那么问题-当它在Aurora上运行时,上面的SQL查询有问题吗?也许对此有已知的解决方法?预先感谢。

0 个答案:

没有答案