GCP POSTGRES SQL导入数据

时间:2019-08-05 11:17:33

标签: sql postgresql google-cloud-platform permissions psql

从生产到预生产的导入转储数据时遇到了问题。

这是我收到的错误消息:

line

当我在所有数据库上创建仅具有“选择”特权的新角色时,会出现错误,以便连接数据工作室以阻止向使用此指令管理数据库的人插入数据的权限:

WARNING:  no privileges could be revoked for "public"
WARNING:  no privileges could be revoked for "public"
WARNING:  no privileges were granted for "public"
WARNING:  no privileges were granted for "public"
ERROR:  must be member of role "postgres"

我也尝试删除其中的角色,但我收到此消息:

GRANT CONNECT ON DATABASE "xxx" TO "dataset-generator";
GRANT SELECT ON ALL TABLES IN SCHEMA public TO "dataset-generator";
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO "dataset-generator";

为避免此问题,我还尝试重新分配“数据集生成器”的角色,但在GCP SQL实例上是不可能的。

我知道这是转储文件的问题:

ERROR: role "dataset-generator" cannot be dropped because some objects depend on it
  Detail: privileges for database aaaa
privileges for database ssss
privileges for database dddd
2 objects in database fff
1 object in database ggg
1 object in database hhhh
1 object in database jjjj
1 object in database kkkkk
1 object in database lllll
1 object in database qqqq

如何使用GCP从转储中删除这些行?

对此有任何帮助吗?

谢谢,问候

0 个答案:

没有答案