az postgres db
Manage PostgreSQL databases on a server. Is scheduled to retire by March 28, 2025.
Commands
Name | Description | Type | Status |
---|---|---|---|
az postgres db create |
Create a PostgreSQL database. |
Core | GA |
az postgres db delete |
Delete a database. |
Core | GA |
az postgres db list |
List the databases for a server. |
Core | GA |
az postgres db show |
Show the details of a database. |
Core | GA |
az postgres db create
Create a PostgreSQL database.
az postgres db create --name
--resource-group
--server-name
[--charset]
[--collation]
Examples
Create database 'testdb' in the server 'testsvr' with the default parameters.
az postgres db create -g testgroup -s testsvr -n testdb
Create database 'testdb' in server 'testsvr' with a given character set and collation rules.
az postgres db create -g testgroup -s testsvr -n testdb --charset {valid_charset} --collation {valid_collation}
Required Parameters
The name of the database.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
The charset of the database.
The collation of the database.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az postgres db delete
Delete a database.
az postgres db delete --name
[--ids]
[--resource-group]
[--server-name]
[--subscription]
[--yes]
Examples
Delete database 'testdb' in the server 'testsvr'.
az postgres db delete -g testgroup -s testsvr -n testdb
Required Parameters
The name of the database.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
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.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Do not prompt for confirmation.
Property | Value |
---|---|
Default value: | False |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az postgres db list
List the databases for a server.
az postgres db list --resource-group
--server-name
Examples
List databases in the server 'testsvr'.
az postgres db list -g testgroup -s testsvr
Required Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the Server.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az postgres db show
Show the details of a database.
az postgres db show --name
[--ids]
[--resource-group]
[--server-name]
[--subscription]
Examples
Show database 'testdb' in the server 'testsvr'.
az postgres db show -g testgroup -s testsvr -n testdb
Required Parameters
The name of the database.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
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.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |