Cannot drop an azure postgres database with logical subscription

Jordi Urios 0 Reputation points
2024-12-04T16:38:28.32+00:00

Hi there,

I've been playing with logical replication with a postgres database in Azure. I created two database (main and replica) on the same postgres service and then I created a publication on the main database and a subscription on the replica. Unfortunately, I wasn't able to make the replication works (that's another problem ^^). Then, I removed, using the Azure panel, both databases. The main database has been dropped successfully. However, the replica failed. I tried to drop the database using a SQL client (dbeaver) afterwards and I see the problem is that there is an active subscription.

The problem is that I cannot drop that subscription. With drop subscription sub1 I get the error that sub1 does not exist (but is listed when I run select * from pg_subscription;). After a bit of google research, I saw that I have to connect to the replica database in order to remove the subscription but... I cannot connect to the replica database (the error is is not currently accepting connections). Looks like the replica database is in an unstable state as I see it in some places (like Azure panel or when I select * frompg_stat_database`) but in other places is hidden (like en Dbeaver navigation list).

I'm not sure how to fix this problem. Can someone help me?

Thanks.

Azure Database for PostgreSQL
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.