Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dsouzajude/90ce7388d56831e2ce3260ca9b87bc3f to your computer and use it in GitHub Desktop.
Save dsouzajude/90ce7388d56831e2ce3260ca9b87bc3f to your computer and use it in GitHub Desktop.
Cleanup operation after PostgreSQL logical replication
/*
* These statements will perform the cleanup operation of a PostgreSQL logical replication
* Both the publisher and the subscriber databases need to be online for this to work.
*/
-- These statements should run on the subscriber database
ALTER SUBSCRIPTION <SUBCRIPTION_NAME> DISABLE;
DROP SUBSCRIPTION <SUBCRIPTION_NAME>;
-- These statements should run on the publisher database
DROP PUBLICATION <PUBLICATION_NAME>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment