gpt4 book ai didi

postgresql - 无法从 PostgresQL 取消订阅

转载 作者:行者123 更新时间:2023-12-05 02:40:09 24 4
gpt4 key购买 nike

我正在使用 pgAdmin,无法删除数据库中的订阅或删除数据库。

当我尝试删除数据库时收到错误消息

ERROR: database "xxxx" is being used by logical replication subscription DETAIL: There are 4 subscriptions.

当我试图放弃我收到的订阅时

ERROR: could not drop the replication slot "xxxx" on publisher DETAIL: The error was: ERROR: replication slot "xxxx" does not exist

查询复制槽时我收到 0 个结果

select * from pg_replication_slots

当我查询订阅时,它们都会出现

SELECT * FROM pg_subscription

非常感谢任何帮助!

最佳答案

不幸的是,你必须经历这个精心设计的舞蹈:

alter subscription <sub1> disable;
alter subscription <sub1> set (slot_name = none);
drop subscription <sub1>;

对于每个订阅,在删除数据库之前。

我认为这种怪诞行为的理由是,他们想让放弃订阅变得非常困难,同时又不放弃它为发布者提供的服务。您可以做到,对于每个订阅,您只需按照自己的方式执行两步。

关于postgresql - 无法从 PostgresQL 取消订阅,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68720250/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com