Re: BDR: cannot drop database even after parting the node - Mailing list pgsql-general

From Florin Andrei
Subject Re: BDR: cannot drop database even after parting the node
Date
Msg-id ad87abad5a77ef5a4e52786fe37bcf0b@andrei.myip.org
Whole thread Raw
In response to Re: BDR: cannot drop database even after parting the node  (Florin Andrei <florin@andrei.myip.org>)
List pgsql-general
This procedure seems to work for dismantling the replication cluster
after I'm done and cleaning up test databases. If there might be any
issues with these steps, please let me know. Thanks.


-- Disconnect node2 from cluster
--
-- on node1 run:
SELECT bdr.bdr_part_by_node_names('{node2}');
-- on node2 run:
BEGIN;
SET LOCAL bdr.permit_unsafe_ddl_commands = true;
SET LOCAL bdr.skip_ddl_locking = true;
SECURITY LABEL FOR 'bdr' ON DATABASE bdrdemo IS '{"bdr": false}';
COMMIT;
-- On node2 restart PG service.
-- Now it's disconnected.
-- To drop the test database on node2, run:
DROP DATABASE bdrdemo;


-- Convert node1 to standalone, then clean slate.
--
-- Show replication slots:
SELECT * FROM pg_catalog.pg_replication_slots;
-- Drop any slots listed there:
-- SELECT pg_drop_replication_slot('slot_name');
TRUNCATE TABLE bdr.bdr_nodes;
TRUNCATE TABLE bdr.bdr_connections;
BEGIN;
SET LOCAL bdr.permit_unsafe_ddl_commands = true;
SET LOCAL bdr.skip_ddl_locking = true;
SECURITY LABEL FOR 'bdr' ON DATABASE bdrdemo IS '{"bdr": false}';
COMMIT;
-- Restart PG service.
-- To drop test database:
DROP DATABASE bdrdemo;


--
Florin Andrei
http://florin.myip.org/


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Hiding name and version
Next
From: Michael Chau
Date:
Subject: Broken primary key after backup restore.