1

我在删除和创建订阅时遇到问题 - 我认为这些消息是说它存在于副本而不是主节点上:

db=#   CREATE SUBSCRIPTION sub 
db-#   CONNECTION 'dbname=db host=some.domain.com user=logical_replicator password=xxxxxxx' 
db-#   PUBLICATION pub;
ERROR:  subscription "sub" already exists
db=# DROP subscription sub;
ERROR:  could not drop the replication slot "sub" on publisher
DETAIL:  The error was: ERROR:  replication slot "sub" does not exist

如何重新创建此订阅?

4

1 回答 1

2

我在文档中找到了答案:

db =# ALTER SUBSCRIPTION sub DISABLE;
ALTER SUBSCRIPTION
db =# ALTER SUBSCRIPTION sub SET (slot_name=NONE);
ALTER SUBSCRIPTION
db =# drop subscription sub;
于 2020-07-03T19:35:21.113 回答