我目前正在尝试在 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