在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查询有问题吗?也许对此有已知的解决方法?预先感谢。