[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eDatabase parameters for AlloyDB Omni can be configured by modifying Grand Unified Configuration (GUC) parameters in either the \u003ccode\u003epostgresql.conf\u003c/code\u003e file or the database cluster manifest.\u003c/p\u003e\n"],["\u003cp\u003eIn VM environments, edit the \u003ccode\u003epostgresql.conf\u003c/code\u003e file to update parameters, and then reload the file for the changes to take effect, such as by restarting the Docker instance.\u003c/p\u003e\n"],["\u003cp\u003eOn Kubernetes clusters, database parameters are managed in the \u003ccode\u003eparameters\u003c/code\u003e field of the \u003ccode\u003eprimarySpec\u003c/code\u003e within the database cluster manifest, using key-value pairs for each parameter.\u003c/p\u003e\n"],["\u003cp\u003eParameters that require a restart, indicated by \u003ccode\u003epg_catalog.pg_settings.context = 'postmaster'\u003c/code\u003e, will automatically trigger a database restart when updated on Kubernetes clusters.\u003c/p\u003e\n"],["\u003cp\u003eYou can view the currently applied parameters using the \u003ccode\u003ekubectl get dbclusters.alloydbomni.dbadmin.goog dbcluster-sample -o jsonpath={.status.primary.currentParameters}\u003c/code\u003e command, noting that discrepancies can occur if invalid parameter settings are applied.\u003c/p\u003e\n"]]],[],null,["# Configure AlloyDB Omni database parameters\n\nSelect a documentation version: 15.7.0keyboard_arrow_down\n\n- [Current (16.8.0)](/alloydb/omni/current/docs/configure-database-flags)\n- [16.8.0](/alloydb/omni/16.8.0/docs/configure-database-flags)\n- [16.3.0](/alloydb/omni/16.3.0/docs/configure-database-flags)\n- [15.12.0](/alloydb/omni/15.12.0/docs/configure-database-flags)\n- [15.7.1](/alloydb/omni/15.7.1/docs/configure-database-flags)\n- [15.7.0](/alloydb/omni/15.7.0/docs/configure-database-flags)\n- [15.5.5](/alloydb/omni/15.5.5/docs/configure-database-flags)\n\n\u003cbr /\u003e\n\nTo configure a database parameter for AlloyDB Omni, you can update [Grand Unified Configuration (GUC) parameters](https://www.postgresql.org/docs/current/config-setting.html) in either of the following:\n\n\u003cbr /\u003e\n\n- The `postgresql.conf` file for environments running AlloyDB Omni on a VM.\n\n- The database cluster manifest for environments running AlloyDB Omni on [a Kubernetes cluster](/alloydb/omni/15.7.0/docs/deploy-kubernetes).\n\nUpdate a parameter in containerized AlloyDB Omni\n------------------------------------------------\n\nIn an AlloyDB Omni running on a VM, you can update a parameter by editing the `postgresql.conf` file as follows:\n\n1. Locate the `postgresql.conf` configuration file for your installation of\n AlloyDB Omni.\n\n2. Use a text editor to add or update a database flag in `postgresql.conf`.\n\n For example, to\n [enforce password expiration](/alloydb/omni/15.7.0/docs/manage-password-policy#enforce-password-expiration),\n set the following flag in the `postgresql.conf` file: \n\n password.enforce_expiration = ON\n\n3. After your database flags are added or edited, reload the `postgresql.conf`\n file for the changes to take effect. For example, if you\n [installed AlloyDB Omni using Docker](/alloydb/omni/15.7.0/docs/quickstart#install-using-docker),\n run the following to restart your Docker instance and reload\n `postgresql.conf`:\n\n docker restart \u003cvar translate=\"no\"\u003eCONTAINER-NAME\u003c/var\u003e\n\nFor more\ninformation, see\n[Setting parameters](https://www.postgresql.org/docs/current/config-setting.html)\nin PostgreSQL documentation.\n\nUpdate a parameter in AlloyDB Omni on a Kubernetes cluster\n----------------------------------------------------------\n\nYou can configure database parameters using the `parameters` field in the `primarySpec` section of your database cluster manifest: \n\n spec:\n primarySpec:\n parameters:\n \"\u003cvar translate=\"no\"\u003ePARAMETER_NAME\u003c/var\u003e\": \"\u003cvar translate=\"no\"\u003ePARAMETER_VALUE\u003c/var\u003e\"\n ...\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePARAMETER_NAME\u003c/var\u003e: the name of the parameter---for example, `autovacuum`.\n- \u003cvar translate=\"no\"\u003ePARAMETER_VALUE\u003c/var\u003e: the value of the parameter---for example, `off`.\n\n| **Note:** Repeat the \u003cvar translate=\"no\"\u003ePARAMETER_NAME\u003c/var\u003e`\": \"`\u003cvar translate=\"no\"\u003ePARAMETER_VALUE\u003c/var\u003e line of code for each name-value pair that you have.\n\nSome parameters require you to restart your cluster for the changes to take effect. You can obtain a list of parameters that require a restart from `pg_catalog.pg_settings`. Any parameter with `pg_catalog.pg_settings.context = 'postmaster'` requires a restart.\n\nTo update database parameters, run the following command: \n\n kubectl patch dbclusters.alloydbomni.dbadmin.goog dbcluster-sample -p '{\"spec\":{\"primarySpec\":{\"parameters\": {\"\u003cvar translate=\"no\"\u003ePARAMETER_NAME\u003c/var\u003e\": \"\u003cvar translate=\"no\"\u003ePARAMETER_VALUE\u003c/var\u003e\"}}}}' --type=merge\n\n| **Note:** For parameters that require a restart, updating parameters restarts the database automatically.\n\nParameter settings are located in the `status` part of the `currentParameters` field.\n\nTo view database parameters, run the following: \n\n kubectl get dbclusters.alloydbomni.dbadmin.goog dbcluster-sample -o jsonpath={.status.primary.currentParameters}\n\nThe output looks similar to the following: \n\n {\"autovacuum\":\"off\",\"max_connections\":\"3000\"}\n\nIf AlloyDB Omni cannot apply the parameters that you request in the database cluster manifest, then the values for the `currentParameters` field can differ from the values in the `parameters` field of your manifest. For example, you apply a non-existent parameter or you set a string value to an integer parameter."]]