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-04 UTC."],[[["\u003cp\u003eAlloyDB Omni database parameters can be configured by updating Grand Unified Configuration (GUC) parameters.\u003c/p\u003e\n"],["\u003cp\u003eFor AlloyDB Omni running on a VM, parameters are updated by editing the \u003ccode\u003epostgresql.conf\u003c/code\u003e file, adding or modifying database flags, and then reloading the file.\u003c/p\u003e\n"],["\u003cp\u003eIn containerized AlloyDB Omni, updating a parameter requires the use of the \u003ccode\u003epostgresql.conf\u003c/code\u003e configuration file in which database flags are adjusted, followed by a restart of the Docker container.\u003c/p\u003e\n"],["\u003cp\u003eFor AlloyDB Omni on a Kubernetes cluster, database parameters are configured via the \u003ccode\u003eparameters\u003c/code\u003e field in the \u003ccode\u003eprimarySpec\u003c/code\u003e section of the database cluster manifest, with some parameters requiring a cluster restart to take effect.\u003c/p\u003e\n"],["\u003cp\u003eYou can use kubectl to apply, view, and update parameters in an AlloyDB Omni on a Kubernetes Cluster, with updates to parameters that require a restart causing the database to restart automatically.\u003c/p\u003e\n"]]],[],null,["# Configure AlloyDB Omni database parameters\n\nSelect a documentation version: Current (16.8.0)keyboard_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/current/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/current/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/current/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."]]