Stay organized with collections
Save and categorize content based on your preferences.
This page describes how to add database flags for an instance, modify database
flags, and delete database flags from an instance in an AlloyDB for PostgreSQL
cluster.
You use database flags for many operations, including adjusting PostgreSQL
parameters, adjusting options, and configuring and tuning an instance.
Modifications to a database flag's value persist for its
instance until you remove the flag or you modify its value again.
In some cases, setting one flag may require that you set another flag to
fully enable the desired functionality.
After you set, remove, or modify a flag for a database instance,
AlloyDB might restart the instance. This depends upon the flag,
as listed in
Supported database flags.
When you modify a database flag in the primary or a read pool instance
that needs a restart, you can choose one of the following maintenance policies:
Low downtime. This policy is enabled by default. We recommend
using this policy for all your production AlloyDB
clusters because it minimizes application downtime.
With the low downtime policy enabled, updating a flag that requires a
restart on your cluster's primary instance has these effects:
The primary instance experiences less than one second of downtime
for most workloads.
The flag on the primary instance finishes updating to its new value
after about 15 minutes.
Updating a flag that requires a restart on a read pool instance has
these effects:
The read pool instance does not require any downtime.
The flag on the read pool instance finishes updating to its new
value after about 10 minutes.
Force apply. To apply flag updates faster, use the FORCE_APPLY
option with the gcloud beta alloydb instances update command.
This policy is more appropriate for development environments, letting
you quickly add or modify flags in exchange for longer instance
downtime and a temporary decrease in database performance or
throughput. Your cluster returns to peak performance several minutes
after force applying a flag update.
With the force apply policy enabled, updating a flag that requires a
restart on your cluster's primary instance has these effects:
The primary instance experiences about one minute of downtime.
The flag on the primary instance finishes updating to its new value
after one or two minutes.
Updating a flag that requires a restart on a read pool instance has
these effects:
The read pool instance experiences about one minute of downtime.
The flag on the read pool instance finishes updating to its new
value after one or two minutes.
In the Overview page, go to Instances in your cluster,
select an instance, and then click Edit.
Add, modify, or delete a database flag from your instance:
Add a flag
To add a database flag to your instance, click Add flag.
Select a flag from the New database flag list.
Provide a value for the flag.
Click Done.
Modify a flag
To modify a database flag present in your instance, expand the database
flag and modify the value of the existing flag in the Edit database flag
section.
Click Done.
Delete a flag
To delete a database flag from your instance, select a flag and click
the delete icon.
To apply flag updates more rapidly, include the argument
--update-mode=FORCE_APPLY. Because this can temporarily decrease database
performance, avoid using this option in a production environment.
FLAGS_LIST: A comma-separated list of one or more database flag
specifications. Each specification consists of the name of the flag, an equals
sign (=), and the value to assign to the flags. For database flags that do not
take values, provide the name of the flag followed by an equals sign (=).
REGION_ID: The region where the instance is placed—for example,
us-central1.
CLUSTER_ID: The ID of the cluster where the instance is placed.
PROJECT_ID: The ID of the project where the cluster is placed.
undergoing low or zero downtime maintenance cycle, after you modify database
flags.
To see the list of an instance's current, manually-set flags, run the following
command:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-26 UTC."],[[["\u003cp\u003eThis guide details how to add, modify, and delete database flags for instances within an AlloyDB for PostgreSQL cluster, which are used for various operational adjustments.\u003c/p\u003e\n"],["\u003cp\u003eDatabase flag modifications persist until removed or changed, and sometimes, setting one flag necessitates setting another for full functionality.\u003c/p\u003e\n"],["\u003cp\u003eApplying flag changes may trigger an instance restart, and users can choose between a "Low downtime" policy (recommended for production) or a "Force apply" policy (for faster updates, but with potential downtime and performance dips).\u003c/p\u003e\n"],["\u003cp\u003eThe "Low downtime" policy on primary instances results in minimal downtime (less than one second) and read pools experience zero downtime, while "Force apply" results in about one minute of downtime for both, with flag changes applying much faster.\u003c/p\u003e\n"],["\u003cp\u003eYou can manage database flags via the Google Cloud console or by using the \u003ccode\u003egcloud\u003c/code\u003e command-line tool, being cautious that \u003ccode\u003egcloud\u003c/code\u003e commands can reset unlisted flags to their default values.\u003c/p\u003e\n"]]],[],null,["This page describes how to add database flags for an instance, modify database\nflags, and delete database flags from an instance in an AlloyDB for PostgreSQL\ncluster.\n\nYou use database flags for many operations, including adjusting PostgreSQL\nparameters, adjusting options, and configuring and tuning an instance.\nModifications to a database flag's value persist for its\ninstance until you remove the flag or you modify its value again.\n\nIn some cases, setting one flag may require that you set another flag to\nfully enable the desired functionality.\n\nAfter you set, remove, or modify a flag for a database instance,\nAlloyDB might restart the instance. This depends upon the flag,\nas listed in\n[Supported database flags](https://cloud.google.com/alloydb/docs/reference/database-flags).\n\nWhen you modify a database flag in the primary or a read pool instance\nthat needs a restart, you can choose one of the following maintenance policies:\n\n- **Low downtime.** This policy is enabled by default. We recommend\n using this policy for all your production AlloyDB\n clusters because it minimizes application downtime.\n\n With the low downtime policy enabled, updating a flag that requires a\n restart on your cluster's primary instance has these effects:\n - The primary instance experiences less than one second of downtime\n for most workloads.\n\n - The flag on the primary instance finishes updating to its new value\n after about 15 minutes.\n\n Updating a flag that requires a restart on a read pool instance has\n these effects:\n - The read pool instance does not require any downtime.\n\n - The flag on the read pool instance finishes updating to its new\n value after about 10 minutes.\n\n- **Force apply.** To apply flag updates faster, use the `FORCE_APPLY`\n option with the `gcloud beta alloydb instances update` command.\n\n This policy is more appropriate for development environments, letting\n you quickly add or modify flags in exchange for longer instance\n downtime and a temporary decrease in database performance or\n throughput. Your cluster returns to peak performance several minutes\n after force applying a flag update.\n\n With the force apply policy enabled, updating a flag that requires a\n restart on your cluster's primary instance has these effects:\n - The primary instance experiences about one minute of downtime.\n\n - The flag on the primary instance finishes updating to its new value\n after one or two minutes.\n\n Updating a flag that requires a restart on a read pool instance has\n these effects:\n - The read pool instance experiences about one minute of downtime.\n\n - The flag on the read pool instance finishes updating to its new\n value after one or two minutes.\n\n\nBefore you begin\n\n- The Google Cloud project you are using must have been [enabled to access AlloyDB](/alloydb/docs/project-enable-access).\n- You must have one of these IAM roles in the Google Cloud project you are using:\n - `roles/alloydb.admin` (the AlloyDB Admin predefined IAM role)\n - `roles/owner` (the Owner basic IAM role)\n - `roles/editor` (the Editor basic IAM role)\n\n If you don't have any of these roles, contact your Organization Administrator to request\n access.\n\n\u003cbr /\u003e\n\nConsole\n\n1. In the Google Cloud console, go to the **Clusters** page.\n\n [Go to Clusters](https://console.cloud.google.com/alloydb/clusters)\n2. Click a cluster in the **Resource Name** column.\n\n3. In the **Overview** page, go to **Instances in your cluster** ,\n select an instance, and then click **Edit**.\n\n4. Add, modify, or delete a database flag from your instance:\n\n **Add a flag**\n 1. To add a database flag to your instance, click **Add flag**.\n 2. Select a flag from the **New database flag** list.\n 3. Provide a value for the flag.\n 4. Click **Done**.\n\n **Modify a flag**\n 1. To modify a database flag present in your instance, expand the database flag and modify the value of the existing flag in the **Edit database flag** section.\n 2. Click **Done**.\n\n **Delete a flag**\n 1. To delete a database flag from your instance, select a flag and click the delete icon.\n 2. Click **Done**.\n5. Click **Update instance**.\n\ngcloud\n\nUse the [`gcloud alloydb instances update`](/sdk/gcloud/reference/beta/alloydb/instances/update)\ncommand to change the database flags for an instance.\n**Caution:** Running the following command overwrites all database flags that are previously set. Any database flags that are not explicitly included in the `--database-flags` list are reset to its default value. To retain your instance's database flags while adding new flags, you must include both current and new flags in the `--database-flags` list. \n\n gcloud alloydb instances update \u003cvar translate=\"no\"\u003eINSTANCE_ID\u003c/var\u003e \\\n --database-flags \u003cvar translate=\"no\"\u003eFLAGS_LIST\u003c/var\u003e \\\n --region=\u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e \\\n --cluster=\u003cvar translate=\"no\"\u003eCLUSTER_ID\u003c/var\u003e \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\n\nTo apply flag updates more rapidly, include the argument\n`--update-mode=FORCE_APPLY`. Because this can temporarily decrease database\nperformance, avoid using this option in a production environment. \n\n gcloud beta alloydb instances update \u003cvar translate=\"no\"\u003eINSTANCE_ID\u003c/var\u003e \\\n --database-flags \u003cvar translate=\"no\"\u003eFLAGS_LIST\u003c/var\u003e \\\n --region=\u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e \\\n --cluster=\u003cvar translate=\"no\"\u003eCLUSTER_ID\u003c/var\u003e \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --update-mode=FORCE_APPLY\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eINSTANCE_ID\u003c/var\u003e: The ID of the instance.\n- \u003cvar translate=\"no\"\u003eFLAGS_LIST\u003c/var\u003e: A comma-separated list of one or more database flag specifications. Each specification consists of the name of the flag, an equals sign (=), and the value to assign to the flags. For database flags that do not take values, provide the name of the flag followed by an equals sign (=).\n- \u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e: The region where the instance is placed---for example, `us-central1`.\n- \u003cvar translate=\"no\"\u003eCLUSTER_ID\u003c/var\u003e: The ID of the cluster where the instance is placed.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project where the cluster is placed. undergoing low or zero downtime maintenance cycle, after you modify database flags.\n\nTo see the list of an instance's current, manually-set flags, run the following\ncommand: \n\n gcloud alloydb instances describe \u003cvar translate=\"no\"\u003eINSTANCE_ID\u003c/var\u003e \\\n --region=\u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e \\\n --cluster=\u003cvar translate=\"no\"\u003eCLUSTER_ID\u003c/var\u003e \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e"]]