Share via


az postgres flexible-server db

Manage PostgreSQL databases on a flexible server.

Commands

Name Description Type Status
az postgres flexible-server db create

Create a PostgreSQL database on a flexible server.

Core GA
az postgres flexible-server db delete

Delete a database on a flexible server.

Core GA
az postgres flexible-server db list

List the databases for a flexible server.

Core GA
az postgres flexible-server db show

Show the details of a database.

Core GA

az postgres flexible-server db create

Create a PostgreSQL database on a flexible server.

az postgres flexible-server db create --resource-group
                                      --server-name
                                      [--charset]
                                      [--collation]
                                      [--database-name]

Examples

Create database 'testDatabase' in the flexible server 'testserver' with the default parameters.

az postgres flexible-server db create --resource-group testGroup --server-name testserver --database-name testDatabase

Create database 'testDatabase' in the flexible server 'testserver' with a given character set and collation rules.

az postgres flexible-server db create --resource-group testGroup --server-name testserver --database-name testDatabase \ --charset validCharset --collation validCollation

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--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.

Optional Parameters

--charset

The charset of the database. The default value is UTF8.

--collation

The collation of the database.

--database-name -d

The name of the database to be created when provisioning the database server.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az postgres flexible-server db delete

Delete a database on a flexible server.

az postgres flexible-server db delete [--database-name]
                                      [--ids]
                                      [--resource-group]
                                      [--server-name]
                                      [--subscription]
                                      [--yes]

Examples

Delete database 'testDatabase' in the flexible server 'testserver'.

az postgres flexible-server db delete --resource-group testGroup --server-name testserver --database-name testDatabase

Optional Parameters

--database-name -d

The name of the database to be created when provisioning the database server.

--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=<name>.

--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.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--yes -y

Do not prompt for confirmation.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az postgres flexible-server db list

List the databases for a flexible server.

az postgres flexible-server db list --resource-group
                                    --server-name

Examples

List databases in the flexible server 'testserver'.

az postgres flexible-server db list --resource-group testGroup --server-name testserver

List databases in the flexible server 'testserver' in table format.

az postgres flexible-server db list --resource-group testGroup --server-name testserver --output table

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--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.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az postgres flexible-server db show

Show the details of a database.

az postgres flexible-server db show [--database-name]
                                    [--ids]
                                    [--resource-group]
                                    [--server-name]
                                    [--subscription]

Examples

Show database 'testDatabase' in the server 'testserver'.

az postgres flexible-server db show --resource-group testGroup --server-name testserver --database-name testDatabase

Optional Parameters

--database-name -d

The name of the database to be created when provisioning the database server.

--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=<name>.

--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.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.