I cannot drop database having logical replication SUBSCRIPTION, when i try to dropdb i get an error saying that the database contains a subscription but when i try to drop the SUBSCRIPTION i get an error saying the replication slot does not exist.


Check out the fine documentation:

If this fails, either because the remote host is not reachable or because the remote replication slot cannot be dropped or does not exist or never existed, the DROP SUBSCRIPTION command will fail. To proceed in this situation, disassociate the subscription from the replication slot by executing ALTER SUBSCRIPTION ... SET (slot_name = NONE).

|improve this answer|||||
  • I use: ALTER SUBSCRIPTION <<sub_name>> disable; ALTER SUBSCRIPTION <<sub_name>> SET (slot_name = NONE); DROP SUBSCRIPTION <<sub_name>>; – Diego Scaravaggi Feb 6 at 10:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.