az postgres db

管理伺服器上的 PostgreSQL 資料庫。

命令

名稱 Description 類型 狀態
az postgres db create

建立 PostgreSQL 資料庫。

核心 GA
az postgres db delete

刪除資料庫。

核心 GA
az postgres db list

列出伺服器的資料庫。

核心 GA
az postgres db show

顯示資料庫的詳細資料。

核心 GA

az postgres db create

建立 PostgreSQL 資料庫。

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

範例

使用預設參數在伺服器 'testvr' 中建立資料庫 'testdb'。

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

使用指定的字元集和定序規則,在伺服器 'testsvr' 中建立資料庫 'testdb'。

az postgres db create -g testgroup -s testsvr -n testdb --charset {valid_charset} --collation {valid_collation}

必要參數

--name -n

資料庫的名稱。

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--server-name -s

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

選擇性參數

--charset

資料庫的字元集。

--collation

資料庫的定序。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az postgres db delete

刪除資料庫。

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

範例

刪除伺服器 'testsvr' 中的資料庫 'testdb'。

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

必要參數

--name -n

資料庫的名稱。

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源識別碼」引數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」引數。

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--server-name -s

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--yes -y

不提示確認。

預設值: False
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az postgres db list

列出伺服器的資料庫。

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

範例

列出伺服器 'testsvr' 中的資料庫。

az postgres db list -g testgroup -s testsvr

必要參數

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--server-name -s

伺服器的名稱。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az postgres db show

顯示資料庫的詳細資料。

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

範例

在伺服器 'testsvr' 中顯示資料庫 'testdb'。

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

必要參數

--name -n

資料庫的名稱。

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源識別碼」引數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」引數。

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--server-name -s

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。