-- Setup publisher database and tables
CREATE DATABASE db_publisher;

INSERT INTO test_tab VALUES (1, 'foo'), (2, 'bar');
-- Create publication
CREATE PUBLICATION test_publication FOR TABLE test_tab;
SELECT pg_create_logical_replication_slot('test_subscription', 'pgoutput');
-- Create dummy database that is to be dropped at last
CREATE DATABASE dummy;
-- Setup subscriber database and table
CREATE DATABASE db_subscriber;


-- Drop the dummy database
-- This will hang due to a deadlock between the logical replication workers and process executing the DROP
DROP DATABASE dummy;

