![无法在 2 个 GCP CloudSQL 实例之间设置 pglogical 复制](https://linux22.com/image/789462/%E6%97%A0%E6%B3%95%E5%9C%A8%202%20%E4%B8%AA%20GCP%20CloudSQL%20%E5%AE%9E%E4%BE%8B%E4%B9%8B%E9%97%B4%E8%AE%BE%E7%BD%AE%20pglogical%20%E5%A4%8D%E5%88%B6.png)
我目前正在尝试在 2 个 GCP CloudSQL Postgres 实例之间设置pglogical
复制,以便在区域之间快速迁移数据。
我按照 GCP 文档[1] 创建一个replicator
用户,以该用户的身份安装pglogical
扩展并执行所需的配置。
但是,每当我在目标服务上创建订阅时,状态最初变为initializing
然后更改为down. Looking at the
postgres 日志,我可以在目标端看到以下错误:
db=api,user=replicator ERROR: permission denied for function pg_replication_origin_session_setup
我可以在目标数据库中看到提到的函数,但是每当我尝试GRANT EXECUTE
使用它时,都会收到如下警告。
postgres=> \df+ pg_replication_origin_session_setup
List of functions
Schema | Name | Result data type | Argument data types | Type | Volatility | Parallel | Owner | Securi
ty | Access privileges | Language | Source code | Description
------------+-------------------------------------+------------------+---------------------+------+------------+----------+---------------+-------
---+-----------------------------------+----------+-------------------------------------+---------------------------------------------------------
-----------------------------
pg_catalog | pg_replication_origin_session_setup | void | text | func | volatile | unsafe | cloudsqladmin | invoke
r | cloudsqladmin=X/cloudsqladmin +| internal | pg_replication_origin_session_setup | configure session to maintain replication progress track
ing for the passed in origin
| | | | | | | |
| cloudsqlsuperuser=X/cloudsqladmin | | |
(1 row)
postgres=> \du replicator
List of roles
Role name | Attributes | Member of
------------+-------------+---------------------
replicator | Replication | {cloudsqlsuperuser}
postgres=> GRANT EXECUTE ON FUNCTION pg_catalog.pg_replication_origin_session_setup TO replicator;
WARNING: no privileges were granted for "pg_replication_origin_session_setup"
GRANT
有人曾经在 CloudSQL 上进行过设置吗pglogical
?或者见过上述permission denied
错误?
提前致谢。Gavin