Stay organized with collections Save and categorize content based on your preferences.
This page describes how to configure database flags for Cloud SQL, and lists the flags that you can set for your instance. You use database flags for many operations, including adjusting PostgreSQL parameters, adjusting options, and configuring and tuning an instance.
In some cases, setting one flag may require that you set another flag to fully enable the functionality you want to use.
When you set, remove, or modify a flag for a database instance, the database might be restarted. The flag value is then persisted for the instance until you remove it. If the instance is the source of a replica, and the instance is restarted, the replica is also restarted to align with the current configuration of the instance.
Configure database flagsThe following sections cover common flag management tasks.
Set a database flag ConsoleEdit the instance:
gcloud sql instances patch INSTANCE_NAME --database-flags=FLAG1=VALUE1,FLAG2=VALUE2
This command will overwrite all database flags previously set. To keep those and add new ones, include the values for all flags you want set on the instance; any flag not specifically included is set to its default value. For flags that don't take a value, specify the flag name followed by an equals sign ("=").
For example, to set the log_connections
and log_min_error_statement
flags, you can use the following command:
gcloud sql instances patch INSTANCE_NAME \ --database-flags=log_connections=on,log_min_error_statement=errorTerraform
To add database flags, use a Terraform resource.
Apply the changesTo apply your Terraform configuration in a Google Cloud project, complete the steps in the following sections.
Prepare Cloud ShellSet the default Google Cloud project where you want to apply your Terraform configurations.
You only need to run this command once per project, and you can run it in any directory.
export GOOGLE_CLOUD_PROJECT=PROJECT_ID
Environment variables are overridden if you set explicit values in the Terraform configuration file.
Each Terraform configuration file must have its own directory (also called a root module).
.tf
extension—for example main.tf
. In this tutorial, the file is referred to as main.tf
.
mkdir DIRECTORY && cd DIRECTORY && touch main.tf
If you are following a tutorial, you can copy the sample code in each section or step.
Copy the sample code into the newly created main.tf
.
Optionally, copy the code from GitHub. This is recommended when the Terraform snippet is part of an end-to-end solution.
terraform init
Optionally, to use the latest Google provider version, include the -upgrade
option:
terraform init -upgrade
terraform plan
Make corrections to the configuration as necessary.
yes
at the prompt:
terraform apply
Wait until Terraform displays the "Apply complete!" message.
To delete your changes, do the following:
deletion_protection
argument to false
.
deletion_protection = "false"
yes
at the prompt:
terraform apply
Remove resources previously applied with your Terraform configuration by running the following command and entering yes
at the prompt:
terraform destroy
To set a flag for an existing database:
Before using any of the request data, make the following replacements:
HTTP method and URL:
PATCH https://sqladmin.googleapis.com/v1/projects/project-id/instances/instance-id
Request JSON body:
{ "settings": { "databaseFlags": [ { "name": "flag_name", "value": "flag_value" } ] } }
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
curl -X PATCH \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/v1/projects/project-id/instances/instance-id"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/v1/projects/project-id/instances/instance-id" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/v1/projects/project-id/instances/instance-id", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-21T22:43:37.981Z", "operationType": "UPDATE", "name": "operation-id", "targetId": "instance-id", "selfLink": "https://sqladmin.googleapis.com/v1/projects/project-id/operations/operation-id", "targetProject": "project-id" }
If there are existing flags configured for the database, modify the previous command to include them. The PATCH
command overwrites the existing flags with the ones specified in the request.
To set a flag for an existing database:
Before using any of the request data, make the following replacements:
HTTP method and URL:
PATCH https://sqladmin.googleapis.com/sql/v1beta4/projects/project-id/instances/instance-id
Request JSON body:
{ "settings": { "databaseFlags": [ { "name": "flag_name", "value": "flag_value" } ] } }
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
curl -X PATCH \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/sql/v1beta4/projects/project-id/instances/instance-id"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/sql/v1beta4/projects/project-id/instances/instance-id" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/project-id/instances/instance-id", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-21T22:43:37.981Z", "operationType": "UPDATE", "name": "operation-id", "targetId": "instance-id", "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/project-id/operations/operation-id", "targetProject": "project-id" }
If there are existing flags configured for the database, modify the previous command to include them. The PATCH
command overwrites the existing flags with the ones specified in the request.
Clear all flags to their default values on an instance:
gcloud sql instances patch INSTANCE_NAME \ --clear-database-flags
You are prompted to confirm that the instance will be restarted.
REST v1To clear all flags for an existing instance:
Before using any of the request data, make the following replacements:
HTTP method and URL:
PATCH https://sqladmin.googleapis.com/v1/projects/project-id/instances/instance-id
Request JSON body:
{ "settings": { "databaseFlags": [] } }
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
curl -X PATCH \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/v1/projects/project-id/instances/instance-id"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/v1/projects/project-id/instances/instance-id" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/v1/projects/project-id/instances/instance-id", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-21T22:43:37.981Z", "operationType": "UPDATE", "name": "operation-id", "targetId": "instance-id", "selfLink": "https://sqladmin.googleapis.com/v1/projects/project-id/operations/operation-id", "targetProject": "project-id" }REST v1beta4
To clear all flags for an existing instance:
Before using any of the request data, make the following replacements:
HTTP method and URL:
PATCH https://sqladmin.googleapis.com/sql/v1beta4/projects/project-id/instances/instance-id
Request JSON body:
{ "settings": { "databaseFlags": [] } }
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
curl -X PATCH \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/sql/v1beta4/projects/project-id/instances/instance-id"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/sql/v1beta4/projects/project-id/instances/instance-id" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/project-id/instances/instance-id", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-21T22:43:37.981Z", "operationType": "UPDATE", "name": "operation-id", "targetId": "instance-id", "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/project-id/operations/operation-id", "targetProject": "project-id" }View current values of database flags
To view all current values of the PostgreSQL settings, log into your instance with the
psql
client and enter the following statement:
SELECT name, setting FROM pg_settings;
Note that you can change the value only for supported flags (as listed below).
Determine which database flags have been set for an instanceTo see which flags have been set for a Cloud SQL instance:
ConsoleThe database flags that have been set are listed under the Database flags section.
Get the instance state:
gcloud sql instances describe INSTANCE_NAME
In the output, database flags are listed under the settings
as the collection databaseFlags
. For more information about the representation of the flags in the output, see Instances Resource Representation.
To list flags configured for an instance:
Before using any of the request data, make the following replacements:
HTTP method and URL:
GET https://sqladmin.googleapis.com/v1/projects/project-id/instances/instance-id
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Execute the following command:
curl -X GET \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://sqladmin.googleapis.com/v1/projects/project-id/instances/instance-id"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://sqladmin.googleapis.com/v1/projects/project-id/instances/instance-id" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "settings": { "authorizedGaeApplications": [], "tier": "machine-type", "kind": "sql#settings", "availabilityType": "REGIONAL", "pricingPlan": "PER_USE", "replicationType": "SYNCHRONOUS", "activationPolicy": "ALWAYS", "ipConfiguration": { "privateNetwork": "projects/project-id/global/networks/default", "authorizedNetworks": [], "ipv4Enabled": false }, "locationPreference": { "zone": "zone", "kind": "sql#locationPreference" }, "databaseFlags": [ { "name": "general_log", "value": "on" } ], "dataDiskType": "PD_SSD", "maintenanceWindow": { "kind": "sql#maintenanceWindow", "hour": 0, "day": 0 }, "backupConfiguration": { "startTime": "03:00", "kind": "sql#backupConfiguration", "enabled": true, "binaryLogEnabled": true }, "settingsVersion": "54", "storageAutoResizeLimit": "0", "storageAutoResize": true, "dataDiskSizeGb": "10" } }
In the output, look for the databaseFlags
field.
To list flags configured for an instance:
Before using any of the request data, make the following replacements:
HTTP method and URL:
GET https://sqladmin.googleapis.com/sql/v1beta4/projects/project-id/instances/instance-id
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Execute the following command:
curl -X GET \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://sqladmin.googleapis.com/sql/v1beta4/projects/project-id/instances/instance-id"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://sqladmin.googleapis.com/sql/v1beta4/projects/project-id/instances/instance-id" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "settings": { "authorizedGaeApplications": [], "tier": "machine-type", "kind": "sql#settings", "availabilityType": "REGIONAL", "pricingPlan": "PER_USE", "replicationType": "SYNCHRONOUS", "activationPolicy": "ALWAYS", "ipConfiguration": { "privateNetwork": "projects/project-id/global/networks/default", "authorizedNetworks": [], "ipv4Enabled": false }, "locationPreference": { "zone": "zone", "kind": "sql#locationPreference" }, "databaseFlags": [ { "name": "general_log", "value": "on" } ], "dataDiskType": "PD_SSD", "maintenanceWindow": { "kind": "sql#maintenanceWindow", "hour": 0, "day": 0 }, "backupConfiguration": { "startTime": "03:00", "kind": "sql#backupConfiguration", "enabled": true, "binaryLogEnabled": true }, "settingsVersion": "54", "storageAutoResizeLimit": "0", "storageAutoResize": true, "dataDiskSizeGb": "10" } }
In the output, look for the databaseFlags
field.
Flags not mentioned below are not supported.
For a given flag, Cloud SQL might support a different value or range from the corresponding PostgreSQL parameter or option.
A | C | D | E | F | G | H | I | J | L | M | O | P | R | S | T | V | W
Cloud SQL Flag TypeString
String
boolean
on
| off
String
String
boolean
on
| off
boolean
on
| off
Integer
-1 ... 2147483647
String
text|xml|json|yaml
String
debug5|debug4|debug3|debug2|debug1|debug|
info|notice|warning|log
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
Float
0 ... 1
boolean
on
| off
float
0
... 100
integer
0
... 2147483647
integer
100000
... 2000000000
integer
1
... varies (see note)
262142
. Yes autovacuum_multixact_freeze_max_age integer
10000
... 2000000000
integer
1
... 2147483
s
integer
0
... 100
ms, or -1
to use the vacuum_cost_delay
value
integer
0
... 10000
, or -1
to use the vacuum_cost_limit
value
float
0
... 100
integer
-1
... 2147483647
float
0
... 100
integer
0
... 2147483647
integer
0
... 2147483647
KB, or -1
to use the maintenance_work_mem
value
integer
0
... 256
8
KB.
integer
10
... 10000
ms
integer
0
... 256
8
KB.
integer
0
... 1073741823
Float
0
... 10
float
0.0
... 1.0
integer
0
... 256
8
KB.
integer
30
... 86,400
s
integer
0
... 2147483647
s
integer
0
... 2147483647
boolean
on
| off
off
. Note: This flag is specific to Cloud SQL. Also, Cloud SQL doesn't support the flag for Identity and Access Management (IAM) users. No cloudsql.enable_anon boolean
on
| off
off
. Note: This flag is specific to Cloud SQL. No cloudsql.enable_auto_explain boolean
on
| off
off
. Note: This flag is specific to Cloud SQL. Yes cloudsql.enable_index_advisor boolean
on
| off
off
. Note: This flag is specific to Cloud SQL. Yes cloudsql.enable_maintenance_mode boolean
on
| off
off
. Note: This flag is specific to Cloud SQL. For more information about this flag, see Overcome transaction ID (TXID) wraparound. Yes cloudsql.enable_pgaudit boolean
on
| off
boolean
on
| off
off
Note: This flag is specific to Cloud SQL. For more information about this flag, see pg_bigm. Yes cloudsql.enable_pg_cron boolean
on
| off
off
.
boolean
on
| off
off
. Note: This flag is specific to Cloud SQL. Yes cloudsql.enable_pglogical boolean
on
| off
off
. Note: This flag is specific to Cloud SQL. For more information about this flag, see Setting up logical replication and decoding. Yes cloudsql.enable_pg_squeeze boolean
on
| off
off
. Note: This flag is specific to Cloud SQL. Yes cloudsql.enable_pg_wait_sampling boolean
on
| off
Note: This flag is specific to Cloud SQL. Yes cloudsql.iam_authentication boolean
on
| off
off
. Note: This flag is specific to Cloud SQL. No cloudsql.logical_decoding boolean
on
| off
off
. Note: This flag is specific to Cloud SQL. For more information about this flag, see Setting up logical replication and decoding. Yes cloudsql.max_failed_attempts_user integer
0
... 10000
string
pg_shadow
view and the pg_authid
table. No commit_delay integer
0
... 100000
integer
0
... 1000
enumeration
partition
| on
| off
float
0.0
... inf
float
0.0
... inf
float
0.0
... inf
String
.
boolean
on
| off
boolean
on
| off
Integer
0 ... varies
String
debug5|debug4|debug3|debug2|debug1|debug|
info|notice|warning|error|log|fatal|panic
float
0.0
... 1.0
integer
1
... 2147483647
ms
integer
1
... 10000
string
No default_transaction_deferrable boolean
on
| off
enumeration
serializable
| 'repeatable read'
| 'read committed'
| 'read uncommitted'
integer
8
KB.
18537160
KB. No effective_io_concurrency integer
0
... 1000
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
enumeration
off
| on
| regress
debug_parallel_query
. No from_collapse_limit integer
1
... 2147483647
boolean
on
| off
integer
1
... 10
integer
0
... 2147483647
integer
0
... 2147483647
float
0.0
... 1.0
float
1.5
... 2.0
integer
2
... 2147483647
integer
0
... 2147483647
integer
64
... 2147483647
KB
float
1
... 1000
boolean
on
| off
enumeration
try
| off
integer
0
... 2147483647
ms
integer
1
... varies
integer
1
... 2147483647
integer
0
... 2147483647
ms
integer
0
... 2147483647
ms, or -1
to disable
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
enumeration
terse
| default
| verbose
boolean
on
| off
boolean
on
| off
String
%m [%p]: [%l-1] db=%d,user=%u
, which logs timestamp, process ID, database, and username.
boolean
on
| off
integer
-1
... 2147483647
ms
enumeration
debug5
| debug4
| debug3
| debug2
| debug1
| info
| notice
| warning
| error
| log
| fatal
| panic
enumeration
debug5
| debug4
| debug3
| debug2
| debug1
| info
| notice
| warning
| error
| log
| fatal
| panic
boolean
on
| off
boolean
on
| off
boolean
on
| off
boolean
on
| off
enumeration
none
| ddl
| mod
| all
mod
to log all Data definition language (DDL) statements, plus data-modifying statements such as INSERT
, UPDATE
, DELETE
, TRUNCATE
boolean
on
| off
log_parser_stats
, log_planner_stats
, or log_executor_stats
.
integer
0
... 2147483647
KB, or -1
to disable
string
You specify time zones by name. For example, Europe/London
is the timezone name for London.
You must update this flag manually, on the primary instance and on all read replicas, to account for it.
Timezone names are case insensitive. You can supply the timezone name in any case.
We support UTC+X
as a valid format for this flag, where X
is +/-HH:MM
.
integer
64
... 2147483647
integer
0
... 1000
integer
1024
... 2147483647
KB
integer
14
... varies (see note)
262142
.
The value on replicas must be greater than or equal to the value on the primary. Changes on the primary propagate to replicas that have a value that is lower than the new value on the primary, or that have not been changed from the default value. Such changes on the primary cause the replica to restart.
Yes max_locks_per_transactioninteger
10
... 2,147,483,647
The value on replicas must be greater than or equal to the value on the primary. Changes on the primary propagate to replicas that have a value that is lower than the new value on the primary, or that have not been changed from the default value. Such changes on the primary cause the replica to restart.
Yes max_logical_replication_workersinteger
4
... 8192
integer
0
... varies
Note: Limits based on the RAM in the instance, in the way described for max_worker_processes
.
The value on replicas must be greater than or equal to the value on the primary. Changes on the primary propagate to replicas that have a value that's lower than the new value on the primary, or that haven't been changed from the default value.
If the value on the primary is default
, then the value for the replicas can't be changed. To change the value for the replicas, first, set the value on the primary to an integer.
integer
0
... varies
Note: Limits based on the RAM in the instance, in the way described for max_worker_processes
.
The value on replicas must be greater than or equal to the value on the primary. Changes on the primary propagate to replicas that have a value that's lower than the new value on the primary, or that haven't been changed from the default value.
If the value on the primary is default
, then the value for the replicas can't be changed. To change the value for the replicas, first, set the value on the primary to an integer.
integer
0
... varies
Note: Limits based on the RAM in the instance, in the way described for max_worker_processes
.
The value on replicas must be greater than or equal to the value on the primary. Changes on the primary propagate to replicas that have a value that's lower than the new value on the primary, or that haven't been changed from the default value.
If the value on the primary is default
, then the value for the replicas can't be changed. To change the value for the replicas, first, set the value on the primary to an integer.
integer
0
... 2147483647
integer
-2147483648
... 2147483647
integer
64
... 1048576
Note: The maximum value of this setting scales linearly with the memory available on your instance. Memory size (GB) Maximum value 0 - 1 512 1 - 2 1024 2 - 4 2048 4 - 8 4096 8 - 16 8192 16 - 32 16384 32 - 64 32768 64 - 128 65536 128 - 256 131072 256 - 512 262144 512 - 1024 524288 > 1024 1048576 Yes max_prepared_transactions integer
0
... varies
The value on replicas must be greater than or equal to the value on the primary. Changes on the primary propagate to replicas that have a value that is lower than the new value on the primary, or that have not been changed from the default value. Such changes on the primary cause the replica to restart.
Yes max_replication_slotsinteger
10
... varies
Note: The maximum value of this setting scales linearly with the memory available on your instance. Memory size (GB) Max value 0 - 4 10 4 - 16 32 16 - 32 128 32 - 64 256 64 -128 512 128 - 256 1024 256 - 512 2048 > 512 4096
integer
0
... 2147483647
ms, or -1
to wait forever No max_standby_streaming_delay integer
0
... 2147483647
ms, or -1
to wait forever No max_sync_workers_per_subscription integer
2
... 64
max_logical_replication_workers
. No max_wal_senders integer
10
... varies
max_replication_slots
. Memory size (GB) Max value 0 - 4 10 4 - 16 32 16 - 32 128 32 - 64 256 64 -128 512 128 - 256 1024 256 - 512 2048 > 512 4096
The value on replicas must be greater than or equal to the value on the primary. Changes on the primary propagate to replicas that have a value that is lower than the new value on the primary, or that have not been changed from the default value. Such changes on the primary cause the replica to restart.
Yes max_wal_sizeinteger
2
... 2147483647
The unit is 16 MB (the WAL file size) for version 9.6 and 1 MB for PostgreSQL 10 and above.
The default value is 1504
MB if instance memory more than or equal to 3.75
GB. The default value is 1
GB if instance memory is less than 3.75
GB.
integer
8
... varies
Note: The maximum value of this setting scales linearly with the memory available on your instance. Memory size (GB) Max value from 0 to < 8 10 from 8 to < 16 16 from 16 to < 32 32 from 32 to < 64 64 from 64 to < 128 128 from 128 to < 256 256 from 256 to < 512 512 > 512 1024
The value on replicas must be greater than or equal to the value on the primary. Changes on the primary propagate to replicas that have a value that is lower than the new value on the primary, or that have not been changed from the default value. Such changes on the primary cause the replica to restart.
Yes min_parallel_index_scan_sizeinteger
0
... 715827882
8
KB No min_parallel_table_scan_size integer
0
... 715827882
8
KB No min_parallel_relation_size integer
0
... 715827882
8
KB
integer
32
... 2147483647
The unit is 16 MB (the WAL file size) for version 9.6 and 1 MB for PostgreSQL 10 and above.
No old_snapshot_thresholdinteger
0
... 86400
min, or -1
to disable
float
0.0
... inf
float
0.0
... inf
enumeration
md5
| scram-sha-256
The default depends on the PostgreSQL version. For PostgreSQL versions 10 to 13, the default is md5
. For PostgreSQL 14 and higher, the default is scram-sha-256
.
boolean
on
| off
No pg_bigm.gin_key_limit integer
0
... 2147483647
No pg_bigm.similarity_limit float
0.0
... 1.0
No pg_hint_plan.enable_hint boolean
on
| off
String
off|on|detailed|verbose|0|1||2|3|no|yes|false|true
String
debug5|debug4|debug3|debug2|debug1|debug|
info|notice|warning|error|log
String
debug5|debug4|debug3|debug2|debug1|debug|
info|notice|warning|error|log
boolean
on
| off
boolean
on
| off
off
. Note: For information about the feature that uses this flag, see Setting up logical replication and decoding. Yes pglogical.conflict_log_level String
LOG
.
log_min_messages
. Note: For information about the feature that uses this flag, see Setting up logical replication and decoding. No pglogical.conflict_resolution String
error|apply_remote|keep_local|last_update_wins|first_update_wins
The default is apply_remote
. Note: The values keep_local
, last_update_wins
and first_update_wins
requires track_commit_timestamps
to be enabled on both nodes. For information about the feature that uses this flag, see Setting up logical replication and decoding. No pglogical.extra_connection_options String
boolean
on
| off
on
. Note: For information about the feature that uses this flag, see Setting up logical replication and decoding. Yes pglogical.use_spi boolean
on
| off
off
. Note: For information about the feature that uses this flag, see Setting up logical replication and decoding. Yes pg_stat_statements.max integer
100
... 2147483647
boolean
on
| off
enumeration
none
| top
| all
boolean
on
| off
enumeration
read
| write
| function
| role
| ddl
| misc
| misc_set
| all|none
You can provide multiple classes using a comma-separated list, and subtract a class by prefacing the class with a -
sign. The default is none
.
boolean
on
| off
on
. No pgaudit.log_client boolean
on
| off
off
. No pgaudit.log_level enumeration
debug5
| debug4
| debug3
| debug2
| debug1
| info
| notice
| warning
| error
| log
log
. Additionally, pgaudit.log_level
is enabled only when pgaudit.log_client
is on. No pgaudit.log_parameter boolean
on
| off
off
. No pgaudit.log_relation boolean
on
| off
off
. No pgaudit.log_statement_once boolean
on
| off
off
. No pgaudit.role string
boolean
on
| off
integer
1
... 2147483647
No pg_wait_sampling.history_size integer
1
... 2147483647
No pg_wait_sampling.profile_period integer
1
... 2147483647
No pg_wait_sampling.profile_pid boolean
on
| off
No pg_wait_sampling.profile_queries boolean
on
| off
No random_page_cost float
0.0
... inf
String
auto|force_generic_plan|force_custom_plan
float
0
... 3
No rdkit.avalon_fp_size integer
64
... 9192
No rdkit.dice_threshold float
0
... 1
No rdkit.difference_FP_weight_agents integer
-10
... 10
No rdkit.difference_FP_weight_nonagents integer
1
... 20
No rdkit.do_chiral_sss boolean
on
| off
No rdkit.do_enhanced_stereo_sss boolean
on
| off
No rdkit.featmorgan_fp_size integer
64
... 9192
No rdkit.hashed_atompair_fp_size integer
64
... 9192
No rdkit.hashed_torsion_fp_size integer
64
... 9192
No rdkit.ignore_reaction_agents boolean
on
| off
No rdkit.init_reaction boolean
on
| off
No rdkit.layered_fp_size integer
64
... 9192
No rdkit.morgan_fp_size integer
64
... 9192
No rdkit.move_unmmapped_reactants_to_agents boolean
on
| off
No rdkit.rdkit_fp_size integer
64
... 9192
No rdkit.reaction_difference_fp_size integer
64
... 9192
No rdkit.reaction_difference_fp_type integer
1
... 3
No rdkit.reaction_sss_fp_size integer
64
... 9192
No rdkit.reaction_sss_fp_type integer
1
... 5
No rdkit.sss_fp_size integer
64
... 4096
No rdkit.tanimoto_threshold float
0
... 1
No rdkit.threshold_unmapped_reactant_atoms float
0
... 1
No replacement_sort_tuples integer
0
... 2147483647
Warning: This flag is supported only until PostgreSQL 9.6 for Cloud SQL. No session_replication_role enumeration
origin
| replica
| local
float
0.0
... inf
integer
8
KB.
45
GB of instance memory, the default value is 15085
MB. Yes squeeze.max_xlock_time integer
1
... 2147483647
No squeeze.worker_autostart string
string
enumeration
ssl_min_protocol_version
, with the addition of an empty string, which allows any protocol version to be specified.
enumeration
TLSv1
, TLSv1.1
, TLSv1.2
, TLSv1.3
.
TLSv1
.
boolean
on
| off
boolean
on
| off
integer
0
... 2147483647
integer
0
... 2147483647
integer
0
... 2147483647
integer
100
... 1,073,741,823
8
KB No temp_file_limit integer
1048576
... 2147483647
KB
10262623
KB. No TimeZone string
You specify time zones by name. For example, Europe/London
is the timezone name for London.
You must update this flag manually, on the primary instance and on all read replicas, to account for it.
Timezone names are case insensitive. You can supply the timezone name in any case.
We support UTC+X
as a valid format for this flag, where X
is +/-HH
.
boolean
on
| off
enumeration
debug5
| debug4
| debug3
| debug2
| debug1
| log
| notice
| warning
| error
boolean
on
| off
boolean
on
| off
integer
100
... 102400
boolean
on
| off
boolean
on
| off
enumeration
none
| pl
| all
boolean
on
| off
integer
0
... 100
ms
integer
1
... 10000
integer
0
... 10000
integer
0
... 10000
integer
0
... 10000
integer
0
... 2100000000
integer
0
... 1000000000
integer
0
... 2000000000
integer
0
... 2100000000
integer
0
... 1000000000
integer
0
... 2000000000
integer
8
KB.
enumeration
off
| on
| pglz
| lz4
| zstd
pglz
, lz4
, and zstd
values are supported only for PostgreSQL versions 15 and later. No wal_receiver_timeout integer
0
... 2147483647
This flag affects the WAL sender and receiver. If not appropriately set, this flag affects logical and physical replication. This flag also affects replication performance and latency. A value of zero disables the timeout mechanism. The unit is milliseconds.
No wal_sender_timeoutinteger
0
... 2147483647
This flag affects the WAL sender and receiver. If not appropriately set, this flag affects logical and physical replication. This flag also affects replication performance and latency. A value of zero disables the timeout mechanism. The unit is milliseconds.
No wal_writer_delayinteger
1
... 10000
integer
0
... 2147483647
integer
64
... 2147483647
KB
bgwriter
PostgreSQL has a background writer (bgwriter
) flag. This flag issues writes of new or modified shared buffers. These shared buffers are known as dirty buffers. When the number of clean shared buffers is insufficient, the background writer writes dirty buffers to the file system and marks them as clean.
Two flags associated with the bgwriter
flag are bgwriter_delay
and bgwriter_lru_maxpages
. bgwriter_delay
specifies the delay between activity rounds for the background writer in milliseconds (ms), and bgwriter_lru_maxpages
specifies how many buffers will be written by the background writer.
The default value for the bgwriter
flag is 200 ms
. However, if you select a solid state drive (SSD) that's greater than 500 GB, then the value of the bgwriter_delay
flag is set to 50
, and the value of the bgwriter_lru_maxpages
flag is set to 200
.
For more information about the background writer, see the PostgreSQL documentation.
session_replication_role
PostgreSQL has the session_replication_role
flag, which is designed to be used for logical replication and lets you disable constraint triggers in individual sessions.
Sometimes this flag can also be used for some maintenance operations to circumvent constraint (most often Foreign Key) checks.
This flag can be set in a session by any user which has the REPLICATION
property set. The REPLICATION
property for any user can be set by cloudsqlsuperuser
when one of flags cloudsql.enable_pglogical or cloudsql.logical_decoding is set for the instance.
This flag can not be set for the whole instance.
Troubleshooting Issue Troubleshooting You set the time zone for a session, but it expires when you log off.Connect to the database and set the database time zone to the one you want, either per user or per database.
In Cloud SQL for PostgreSQL, you can specify the following. These settings remain after a session is closed, mimicking a .conf
configuration:
ALTER DATABASE dbname SET TIMEZONE TO 'timezone'; ALTER USER username SET TIMEZONE TO 'timezone';
These settings apply only to new connections to the database. To see the change to the time zone, disconnect from the instance and then reconnect to it.
What's nextExcept as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-02 UTC.
[[["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-07-02 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4