Setelah tanda database ditambahkan atau diedit, muat ulang postgresql.conf
file agar perubahan diterapkan. Misalnya, jika Anda
menginstal AlloyDB Omni menggunakan Docker,
jalankan perintah berikut untuk memulai ulang instance Docker dan memuat ulang
postgresql.conf:
dockerrestartCONTAINER-NAME
Untuk mengetahui informasi selengkapnya, lihat
Menetapkan parameter
dalam dokumentasi PostgreSQL.
Memperbarui parameter di AlloyDB Omni pada cluster Kubernetes
Anda dapat mengonfigurasi parameter database menggunakan kolom parameters di bagian primarySpec manifes cluster database:
PARAMETER_NAME: nama parameter—misalnya, autovacuum.
PARAMETER_VALUE: nilai parameter—misalnya, off.
Beberapa parameter mengharuskan Anda memulai ulang cluster agar perubahan diterapkan. Anda dapat memperoleh daftar parameter yang memerlukan mulai ulang dari pg_catalog.pg_settings. Parameter apa pun dengan pg_catalog.pg_settings.context = 'postmaster' memerlukan mulai ulang.
Untuk mengupdate parameter database, jalankan perintah berikut:
Jika AlloyDB Omni tidak dapat menerapkan parameter yang Anda minta dalam manifes cluster database, nilai untuk kolom currentParameters dapat berbeda dengan nilai di kolom parameters pada manifes Anda. Misalnya, Anda menerapkan parameter yang tidak ada atau menetapkan nilai string ke parameter bilangan bulat.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-05 UTC."],[[["\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 for VM environments or the database cluster manifest for Kubernetes environments.\u003c/p\u003e\n"],["\u003cp\u003eTo update parameters in a VM environment, locate and edit the \u003ccode\u003epostgresql.conf\u003c/code\u003e file, then reload the file, for instance, by restarting the Docker instance if applicable.\u003c/p\u003e\n"],["\u003cp\u003eIn Kubernetes environments, parameters are updated via the \u003ccode\u003eparameters\u003c/code\u003e field in the \u003ccode\u003eprimarySpec\u003c/code\u003e section of the database cluster manifest, using \u003ccode\u003ePARAMETER_NAME\u003c/code\u003e and \u003ccode\u003ePARAMETER_VALUE\u003c/code\u003e pairs.\u003c/p\u003e\n"],["\u003cp\u003eSome parameter changes require a cluster restart, which can be identified by checking \u003ccode\u003epg_catalog.pg_settings.context = 'postmaster'\u003c/code\u003e, and updating such parameters will trigger an automatic restart.\u003c/p\u003e\n"],["\u003cp\u003eYou can verify the applied parameters by checking the \u003ccode\u003ecurrentParameters\u003c/code\u003e field in the \u003ccode\u003estatus\u003c/code\u003e section of the cluster, noting that discrepancies may arise if invalid parameters are specified.\u003c/p\u003e\n"]]],[],null,["# Configure AlloyDB Omni database parameters\n\nSelect a documentation version: 15.7.1keyboard_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.1/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.1/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.1/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."]]