首页 > 数据库 > PostgreSQL > 逻辑复制-删除订阅报错
test=# drop subscription test_slot_sub ;ERROR: could not connect to publisher when attempting to drop the replication slot "test_slot_sub"DETAIL: The error was: could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5433? HINT: Use ALTER SUBSCRIPTION ... SET (slot_name = NONE) to disassociate the subscription from the slot.test=#
test=# drop subscription test_slot_sub ;ERROR: could not drop the replication slot "test_slot_sub" on publisher DETAIL: The error was: ERROR: replication slot "test_slot_sub" does not exist test=#
alter subscription test_slot_sub disable;ALTER SUBSCRIPTION test_slot_sub SET (slot_name = NONE);drop subscription test_slot_sub ;
每一个(活跃的)订阅会从远(发布)端上的一个复制槽接收更改。通常,远程复制槽是在使用CREATE SUBSCRIPTION创建订阅是自动创建的,并且在使用DROP SUBSCRIPTION删除订阅时,复制槽也会自动被删除。不过,在一些情况下,有必要单独操纵订阅以及其底层的复制槽。如下场景:
ref
Replication Slot Management
ref
复制槽管理
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69994931/viewspace-2766386/ ,如需转载,请注明出处,否则将追究法律责任。