gpt4 book ai didi

postgresql - 如何删除 postgres 9.4 中的复制槽

转载 作者:行者123 更新时间:2023-11-29 11:09:10 26 4
gpt4 key购买 nike

我有一个我想删除的复制槽,但是当我删除时,我得到了一个错误,我无法从 View 中删除。有什么想法吗?

postgres=# SELECT * FROM pg_replication_slots ;
slot_name | plugin | slot_type | datoid | database | active | xmin | catalog_xmin | restart_lsn
--------------+--------------+-----------+--------+----------+--------+------+--------------+-------------
bottledwater | bottledwater | logical | 12141 | postgres | t | | 374036 | E/FE8D9010
(1 row)

postgres=# delete from pg_replication_slots;
ERROR: cannot delete from view "pg_replication_slots"
DETAIL: Views that do not select from a single table or view are not automatically updatable.
HINT: To enable deleting from the view, provide an INSTEAD OF DELETE trigger or an unconditional ON DELETE DO INSTEAD rule.
postgres=#

最佳答案

使用pg_drop_replication_slot:

select pg_drop_replication_slot('bottledwater');

参见 the docsthis blog .

复制槽必须处于非事件状态,即没有事件连接。因此,如果有流式副本使用插槽,则必须停止流式副本。或者您可以更改其 recovery.conf,使其不再使用插槽并重新启动它。

关于postgresql - 如何删除 postgres 9.4 中的复制槽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30854961/

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