

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用適用於 PostgreSQL 的受信任語言延伸模組的需求
<a name="PostgreSQL_trusted_language_extension-requirements"></a>

以下是設定和使用 TLE 開發套件時的需求。
+ ** Aurora PostgreSQL 版本 ** - 僅在 Aurora PostgreSQL 14.5 版 及更新版本上支援受信任語言延伸模組。
  + 如果您需要升級 Aurora PostgreSQL 資料庫叢集， 請參閱 [升級 Amazon Aurora PostgreSQL 資料庫叢集](USER_UpgradeDBInstance.PostgreSQL.md)。
  + 如果您還沒有執行 PostgreSQL 的 Aurora 資料庫叢集 ，則可以建立一個。如需詳細資訊，請參閱 [建立 Aurora PostgreSQL 資料庫叢集並與之連線](CHAP_GettingStartedAurora.CreatingConnecting.AuroraPostgreSQL.md)。
+ **需要 `rds_superuser` 權限** - 若要設定 `pg_tle` 延伸模組，您的資料庫使用者角色必須具有 `rds_superuser` 角色的許可。根據預設，會將此角色授予建立 Aurora PostgreSQL 資料庫叢集的 `postgres` 使用者。
+ **需要自訂資料庫參數群組** – 您的 Aurora PostgreSQL 資料庫叢集必須搭配自訂資料庫參數群組進行設定。您會針對 Aurora PostgreSQL 資料庫叢集的寫入器執行個體使用自訂資料庫參數群組。
  + 如果您的 Aurora PostgreSQL 資料庫叢集 未搭配自訂資料庫參數群組進行設定，您應該建立一個，並將其與 Aurora PostgreSQL 資料庫叢集的寫入器執行個體建立關聯。如需步驟的簡短摘要，請參閱 [建立並套用自訂資料庫參數群組](#PostgreSQL_trusted_language_extension-requirements-create-custom-params)。
  + 如果您的 Aurora PostgreSQL 資料庫叢集 已使用自訂資料庫參數群組進行設定，您可以設定受信任語言延伸模組。如需詳細資訊，請參閱[在您的 Aurora PostgreSQL 資料庫叢集中設定受信任語言延伸模組](PostgreSQL_trusted_language_extension-setting-up.md)。

## 建立並套用自訂資料庫參數群組
<a name="PostgreSQL_trusted_language_extension-requirements-create-custom-params"></a>

請使用下列步驟建立自訂資料庫參數群組，並設定您的 Aurora PostgreSQL 資料庫叢集來使用該群組。

### 主控台
<a name="PostgreSQL_trusted_language_extension-requirements-custom-parameters.CON"></a>

**建立自訂資料庫參數群組，並將其與 Aurora PostgreSQL 資料庫叢集 搭配使用**

1. 登入 AWS 管理主控台 ，並在 [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/)：// 開啟 Amazon RDS 主控台。

1. 從 Amazon RDS 功能表中，選擇 Parameter groups (參數群組)。

1. 選擇 **Create parameter group (建立參數群組)**。

1. 在 **Parameter group details** (參數群組詳細資訊) 頁面中，輸入下列資訊：
   + 針對 **Parameter group family** (參數群組系列)，選擇 aurora-postgresql14。 。
   + 針對 **Type** (類型)，選擇 DB Parameter Group (資料庫參數群組)。
   + 針對 **Group name** (群組名稱)，在操作內容中給與您的參數群組一個有意義的名稱。
   + 針對 **Description** (描述)，輸入有用的描述，以便您團隊中的其他成員可以輕鬆找到它。

1. 選擇**建立**。您的自訂資料庫參數群組是在 AWS 區域中建立。您現在可以遵循下列步驟修改 Aurora PostgreSQL 資料庫叢集以使用它。

1. 從 Amazon RDS 功能表中選擇 **Databases** (資料庫)。

1. 從列出的 Aurora PostgreSQL 資料庫叢集中選擇您想要哪一個與 TLE 搭配使用，然後選擇 **Modify** (修改)。

1. 在 Modify DB cluster settings (修改資料庫叢集設定) 頁面中，尋找 **Database options** (資料庫選項)，然後使用選取器選擇您的自訂資料庫參數群組。

1. 選擇 **Continue** (繼續) 以儲存變更。

1. 選擇 **Apply immediately** (立即套用)，以便您可以繼續設定 Aurora PostgreSQL 資料庫叢集以使用 TLE。

若要繼續針對受信任語言延伸模組設定您的系統，請參閱 [在您的 Aurora PostgreSQL 資料庫叢集中設定受信任語言延伸模組](PostgreSQL_trusted_language_extension-setting-up.md)。

如需深入了解如何使用資料庫叢集和資料庫參數群組，請參閱 [Amazon Aurora 資料庫叢集的資料庫叢集參數群組](USER_WorkingWithDBClusterParamGroups.md)。

### AWS CLI
<a name="PostgreSQL_trusted_language_extension-requirements-custom-parameters-CLI"></a>

您可以避免在使用 CLI 命令時指定 `--region` 引數，方法是使用您的預設 AWS 區域來設定您的 AWS CLI 。如需詳細資訊，請參閱《AWS Command Line Interface 使用者指南》**中的[組態基礎概念](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html#cli-configure-quickstart-config)。

**建立自訂資料庫參數群組，並將其與 Aurora PostgreSQL 資料庫叢集 搭配使用**

1. 使用 [create-db-parameter-group](https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-parameter-group.html) AWS CLI 命令，根據 aurora-postgresql14 為您的 建立自訂資料庫參數群組 AWS 區域。請注意，在此步驟中，您會建立資料庫參數群組，以套用至 Aurora PostgreSQL 資料庫叢集的寫入器執行個體。

   對於 Linux、macOS 或 Unix：

   ```
   aws rds create-db-parameter-group \
     --region {{aws-region}} \
     --db-parameter-group-name {{custom-params-for-pg-tle}} \
     --db-parameter-group-family aurora-postgresql14 \
     --description "My custom DB parameter group for Trusted Language Extensions"
   ```

   在 Windows 中：

   ```
   aws rds create-db-parameter-group ^
     --region {{aws-region}} ^
     --db-parameter-group-name {{custom-params-for-pg-tle}} ^
     --db-parameter-group-family aurora-postgresql14 ^
     --description "My custom DB parameter group for Trusted Language Extensions"
   ```

   您的自訂資料庫參數群組可在 AWS 區域中使用，因此您可以修改 Aurora PostgreSQL 資料庫叢集的寫入器執行個體以使用它。

1. 使用 [modify-db-instance](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-instance.html) AWS CLI 命令，將您的自訂資料庫參數群組套用至 Aurora PostgreSQL 資料庫叢集的寫入器執行個體。此命令會立即重新啟動作用中執行個體。

   對於 Linux、macOS 或 Unix：

   ```
   aws rds modify-db-instance \
     --region {{aws-region}} \
     --db-instance-identifier {{your-writer-instance-name}} \
     --db-parameter-group-name {{custom-params-for-pg-tle}} \
     --apply-immediately
   ```

   在 Windows 中：

   ```
   aws rds modify-db-instance ^
     --region {{aws-region}} ^
     --db-instance-identifier {{your-writer-instance-name}} ^
     --db-parameter-group-name {{custom-params-for-pg-tle}} ^
     --apply-immediately
   ```

若要繼續針對受信任語言延伸模組設定您的系統，請參閱 [在您的 Aurora PostgreSQL 資料庫叢集中設定受信任語言延伸模組](PostgreSQL_trusted_language_extension-setting-up.md)。

如需更多詳細資訊，請參閱 [Amazon Aurora 資料庫執行個體的資料庫參數群組](USER_WorkingWithDBInstanceParamGroups.md)。