【发布时间】:2020-08-14 01:48:33
【问题描述】:
这是 Ubuntu 18.04 上的 postgres 10
我将架构从发布者复制到订阅者
pg_dump -d <db> -s | psql <db> -h subscriber_host -U rep
在发布者上将 wal_level 设置为逻辑
ALTER SYSTEM SET wal_level = 'logical';
我在发布者上重新启动了数据库
我连接到数据库
\<db>
创建的出版物
CREATE PUBLICATION my_pub FOR ALL TABLES;
然后将权限授予名为 rep 的现有复制用户
GRANT ALL PRIVILEGES ON DATABASE <db> TO rep;
我现在是订阅者
CREATE Subscription sub CONNECT 'dbname=<db> host=x.x.0.174 user=rep password=password' PUBLICATION my_pub;
数据没有复制过来,订阅服务器上的表仍然是空的。
我在日志中看到以下错误:
2020-08-14 01:26:08.055 UTC [21523] LOG: worker process: logical replication worker for subscription 56144 sync 55996 (PID 435) exited with exit code 1
2020-08-14 01:26:08.057 UTC [437] LOG: logical replication table synchronization worker for subscription "sub", table "wholesaletransfers" has started
2020-08-14 01:26:08.081 UTC [436] ERROR: could not start initial contents copy for table "public.wholesale": ERROR: permission denied for relation wholesale
批发表在时为什么会显示public.wholesale
【问题讨论】:
标签: postgresql