【问题标题】:cloudsql to cloudsql migration permissions issuescloudsql 到 cloudsql 迁移权限问题
【发布时间】:2021-10-14 10:58:39
【问题描述】:

我正在尝试使用 gcp 数据库迁移工具将 cloudsql postgres 9.6 实例迁移到 cloudsql postgres 13 实例。

我在 UI 中使用标志将 cloudsql.enable_pglogicalcloudsql.logical_decoding 都设置为 on,然后重新启动了实例,但在尝试使用 postgres 帐户运行迁移时仍然出现以下错误。

连接到源数据库失败。确保用户具有所需的权限。解决问题,然后重新启动迁移作业。详细信息:复制用户 postgres 没有足够的权限:复制用户对数据库 postgres 中的模式 pglogical 没有 USAGE 权限;复制用户没有对表 public.team_members 的 SELECT 权限,复制用户没有对表 public.doc_comment_read 的 SELECT 权限,复制用户没有对表 public.mailbox_google 的 SELECT 权限,复制用户没有选择权限在表 public.doc_editor 上,复制用户对表 public.mailbox_microsoft 没有 SELECT 权限,复制用户在表 public.enrollment_whitelist 上没有 SELECT 权限,复制用户在表 public.group_members 上没有 SELECT 权限,复制用户对表 public.team_invites 没有 SELECT 权限,复制用户对表 public 没有 SELECT 权限...

【问题讨论】:

  • 您是否尝试将这些权限授予当前用户?

标签: google-cloud-platform google-cloud-sql


【解决方案1】:

所以我发现了一些东西。

  1. 您不能使用 postgres 用户进行此迁移,因为 postgres 用户没有复制属性。

https://cloud.google.com/sql/docs/postgres/users

The postgres user is part of the cloudsqlsuperuser role, and has the following attributes (privileges): CREATEROLE, CREATEDB, and LOGIN. It does not have the SUPERUSER or REPLICATION attributes.

  1. 您需要确保使用数据库的所有者进行迁移,而不是 postgres 用户。

  2. 您必须授予用户对 pglogical 架构的权限。

GRANT USAGE ON SCHEMA pglogical TO my_user; GRANT ALL ON SCHEMA pglogical TO my_user;

  1. 将复制属性添加到您的用户(您需要从 postgres 用户执行此操作)

ALTER ROLE my_user with REPLICATION;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-09
    • 2021-10-05
    • 1970-01-01
    • 1970-01-01
    • 2016-11-27
    • 2017-04-18
    • 2018-07-25
    • 1970-01-01
    相关资源
    最近更新 更多