Home > Blockchain >  Unable to delete PostgreSQL database using CLI
Unable to delete PostgreSQL database using CLI

Time:11-11

I am unable to delete PostgreSQL database in azure using the below command:

az PostgreSQL db delete

Is there any other script such as bash to clean up azure postgreSQL database?

CodePudding user response:

I think you should not say postgresql but postgres - az postgres db delete

CodePudding user response:

Try command to like Delete database 'testdb' in the server 'testsvr':

az postgres db delete -g testgroup -s testsvr -n testdb

Required Parameters --name -n The name of the database.

Optional Parameters --ids One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g Name of resource group. You can configure the default group using az configure --defaults group=.

--server-name -s Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.

--yes -y Do not prompt for confirmation.

To delete the Azure Database for PostgreSQL flexible server, run:

az postgres flexible-server delete --resource-group myresourcegroup --name 
mydemoserver
  • Related