Deleting the postgres DB on azure SQL

Dominic Lee 0 Reputation points
2026-06-25T02:56:15.6866667+00:00
  • Session ID: a202d2f32300443c95c021cef9dec775
  • Conversation ID: 3G3WZw8sXrK5Qi0Rq4dNXc-us
  • Activity ID: 3G3WZw8sXrK5Qi0Rq4dNXc-us|0000002
  • Correlation ID: 3G3WZw8sXrK5Qi0Rq4dNXc-us|0000000

Hi i'm having an issue deleting the postgres db. Any idea why it can't be deleted?

Azure Database for PostgreSQL
0 comments No comments

2 answers

Sort by: Most helpful
  1. Pilladi Padma Sai Manisha 10,770 Reputation points Microsoft External Staff Moderator
    2026-06-30T07:17:46.8833333+00:00

    Hi @Dominic Lee
    Thank you for your question.

    Could you please share the exact error message or error code you receive when attempting to delete the PostgreSQL database? Additionally, please let us know:

    • Are you using Azure Database for PostgreSQL or Azure SQL Database?
    • Are you deleting the database through the Azure portal, Azure CLI, PowerShell, or another method?
    • Is there any resource lock applied to the server or resource group?
    • If possible, please share a screenshot of the error.

    This information will help us identify the root cause and provide the appropriate troubleshooting steps.

    Was this answer helpful?


  2. Alex Burlachenko 23,170 Reputation points MVP Volunteer Moderator
    2026-06-25T08:48:22.2933333+00:00

    Dominic Lee hi, thx for sharing urs issue here at Q&A portal,

    its so hard to tell from only the IDs, but most PostgreSQL delete failures in Azure come down to locks, dependencies, permissions, or a stuck backend operation. If this is Azure Database for PostgreSQL Flexible Server, make sure u are deleting the right resource type. It’s not ‘Azure SQL’ PostgreSQL has its own resource provider. Small naming thing, but it matters when opening support. Common blockers could be delete lock on the server/resource group, private endpoint still attached, backup/restore or scaling op in progress, replica relationship, VNet/subnet dependency, or missing permission like Microsoft.DBforPostgreSQL/flexibleServers/delete.

    Check Activity Log for the failed delete first. The real reason is usually there, not in the portal pop-up.

    az monitor activity-log list \

    --correlation-id '<correlation-id>'

    For the resource itself

    az resource show \

    --ids '<postgres-resource-id>' \

    --query "{state:properties.state, provisioningState:properties.provisioningState}"

    If there’s a lock

    az lock list --resource-group '<rg>'

    https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-delete-server

    https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/lock-resources

    https://learn.microsoft.com/en-us/azure/azure-resource-manager/troubleshooting/error-delete-resource

    If Activity Log only shows generic failure and the server is stuck in Deleting or Updating, open a PostgreSQL support case w/ the Session ID, Activity ID, Correlation ID, server resource ID, region, and UTC time of the failed delete. That’s likely backend cleanup, not something u can fix from psql.

    rgds,

    Alex

    &

    If my answer was helpful pls mark it and additional thx if u follow me at Q&A portal
    

    Was this answer helpful?

    0 comments No comments

Your answer

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