简体   繁体   中英

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

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?

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;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM