How can I get past this problem recreating a pg_logical subscription?

你。 提交于 2021-02-11 12:47:12

问题


I'm having a problem dropping and creating subscriptions - I think these messages are saying it exists on the replica and not the primary:

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

How can I get this subscription recreated?


回答1:


I found the answer in the documentation:

db =# ALTER SUBSCRIPTION sub DISABLE;
ALTER SUBSCRIPTION
db =# ALTER SUBSCRIPTION sub SET (slot_name=NONE);
ALTER SUBSCRIPTION
db =# drop subscription sub;


来源:https://stackoverflow.com/questions/62721015/how-can-i-get-past-this-problem-recreating-a-pg-logical-subscription

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!