Re: BDR: cannot drop database even after parting the node

From: Florin Andrei <florin(at)andrei(dot)myip(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: BDR: cannot drop database even after parting the node
Date: 2015-09-17 20:04:06
Message-ID: ad87abad5a77ef5a4e52786fe37bcf0b@andrei.myip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Chau 2015-09-17 23:31:14 Broken primary key after backup restore.
Previous Message Tom Lane 2015-09-17 18:14:48 Re: Hiding name and version