配置 AlloyDB Omni 数据库标志

如需为 AlloyDB Omni 配置数据库标志,您需要在 postgresql.conf 文件中添加或更新 Grand Unified Configuration (GUC) 参数。

添加或更新 GUC 参数

您可以通过多种方式更新和添加 GUC 参数。本文档介绍了最基本的修改方式,即修改 postgresql.conf 文件。如需了解详情,请参阅 PostgreSQL 文档中的设置参数

如需通过修改 postgresql.config 文件添加或更新 GUC 参数,请执行以下操作:

  1. 找到 AlloyDB Omni 安装的 postgresql.conf 配置文件。

  2. 使用文本编辑器在 postgresql.conf 中添加或更新数据库标志。

    例如,如需强制执行密码过期,请在 postgresql.conf 文件中设置以下标志:

    password.enforce_expiration = ON
    
  3. 添加或修改数据库标志后,请重新加载 postgresql.conf 文件,以使更改生效。例如,如果您使用 Docker 安装了 AlloyDB Omni,请运行以下命令以重启 Docker 实例并重新加载 postgresql.conf

    docker restart CONTAINER-NAME