Después de agregar o editar las marcas de la base de datos, vuelve a cargar el archivo postgresql.conf para que se apliquen los cambios. Por ejemplo, si instalaste AlloyDB Omni con Docker, ejecuta el siguiente comando para reiniciar tu instancia de Docker y volver a cargar postgresql.conf:
PARAMETER_NAME: Es el nombre del parámetro, por ejemplo, autovacuum.
PARAMETER_VALUE: Es el valor del parámetro, por ejemplo, off.
Algunos parámetros requieren que reinicies el clúster para que los cambios surtan efecto. Puedes obtener una lista de los parámetros que requieren un reinicio desde pg_catalog.pg_settings. Cualquier parámetro con pg_catalog.pg_settings.context = 'postmaster' requiere un reinicio.
Para actualizar los parámetros de la base de datos, ejecuta el siguiente comando:
Si AlloyDB Omni no puede aplicar los parámetros que solicitas en el manifiesto del clúster de base de datos, los valores del campo currentParameters pueden diferir de los valores del campo parameters de tu manifiesto. Por ejemplo, aplicas un parámetro inexistente o estableces un valor de cadena en un parámetro de número entero.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-05 (UTC)"],[[["\u003cp\u003eAlloyDB Omni database parameters can be configured by updating 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, edit the \u003ccode\u003epostgresql.conf\u003c/code\u003e file, adding or modifying database flags, then restart the Docker instance if applicable to reload the configurations.\u003c/p\u003e\n"],["\u003cp\u003eIn Kubernetes environments, parameters are configured using the \u003ccode\u003eparameters\u003c/code\u003e field within the \u003ccode\u003eprimarySpec\u003c/code\u003e section of the database cluster manifest, specifying parameter name-value pairs.\u003c/p\u003e\n"],["\u003cp\u003eSome parameters require a cluster restart to take effect, which can be determined by checking \u003ccode\u003epg_catalog.pg_settings.context\u003c/code\u003e for 'postmaster', and updating these parameters will automatically trigger a database restart.\u003c/p\u003e\n"],["\u003cp\u003eYou can view current database parameter settings using \u003ccode\u003ekubectl get\u003c/code\u003e and the status of the applied parameters in the \u003ccode\u003ecurrentParameters\u003c/code\u003e field, which can differ from the manifest if invalid parameters are specified.\u003c/p\u003e\n"]]],[],null,["# Configure AlloyDB Omni database parameters\n\nSelect a documentation version: 16.3.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/16.3.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/16.3.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/16.3.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."]]