microsoft / vscode-cosmosdb

Azure Databases extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-cosmosdb
MIT License
155 stars 68 forks source link

Fail to delete the database of the attached PostgreSQL server #2259

Open v-xinda opened 5 months ago

v-xinda commented 5 months ago

OS: All Build Version: 20240306.1 Regression: Not a regression

Repro Steps:

  1. Create a PostgreSQLSingle server -> Expand it.
  2. Right click the database "postgres" -> Click "Copy Connection String...".
  3. Attach PostgreSQLSingle server without database name, like postgres://us:Daxinge0104@anicole-f-d.postgres.database.azure.com:5432?ssl=true.
  4. Navigate to Workspaces -> Right click the attached PostgreSQLSingle server -> Create a new database.
  5. Right click the above database -> Delete Database... -> Delete.
  6. Chech whether succeeds to delete the database.

Expect: Succeed to delete the database.

Actual: Fail to delete the database. image

More Info:

  1. This issue also reproduces for the PostgreSQLFlexible server.
  2. This issue also reproduces for the unattached PostgreSQL server.
JasonYeMSFT commented 5 months ago

An open connection to the database would prevent people from deleting it. The user can mitigate this issue by connecting to another database. The extension should have a way to reset connection because that database could be the last one that the user can connect to from the extension because we don't let people connect to default databases from the UI.