加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

postgresql – 如何删除Postgres中的复制槽9.4

发布时间:2020-12-13 16:34:15 所属栏目:百科 来源:网络整理
导读:我有复制插槽,我想删除,但当我删除我有一个错误,我无法从视图中删除.有任何想法吗? postgres=# SELECT * FROM pg_replication_slots ; slot_name | plugin | slot_type | datoid | database | active | xmin | catalog_xmin | restart_lsn--------------+--
我有复制插槽,我想删除,但当我删除我有一个错误,我无法从视图中删除.有任何想法吗?
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 docs和this blog.

复制槽必须是非活动的,即没有活动的连接.所以如果有一个流复制使用插槽,你必须停止流复制.或者您可以更改其recovery.conf,以便不再使用插槽并重新启动它.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读