For usage information that might affect the SLA, see the Operational guidelines for Cloud SQL for PostgreSQL instances.
integer
1
... varies (see note)
integer
10000
... 2000000000
integer
1
... 2147483
s integer
0
... 100
ms, or -1
to use the vacuum_cost_delay
valueinteger
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
. boolean
on
| off
off
. boolean
on
| off
off
. boolean
on
| off
off
. boolean
on
| off
off
. boolean
on
| off
boolean
on
| off
off
boolean
on
| off
off
. boolean
on
| off
off
. boolean
on
| off
off
. boolean
on
| off
off
. boolean
on
| off
boolean
on
| off
off
. boolean
on
| off
off
. integer
0
... 10000
string
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
boolean
on
| off
enumeration
serializable
| 'repeatable read'
| 'read committed'
| 'read uncommitted'
integer
8
KB. 18537160
KB.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
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)
Memory (GB) on largest instance | Default value |
---|---|
tiny (~0.5) | 25 |
small (~1.7) | 50 |
from 3.75 to < 6 | 100 |
from 6 to < 7.5 | 200 |
from 7.5 to < 15 | 400 |
from 15 to < 30 | 500 |
from 30 to < 60 | 600 |
from 60 to < 120 | 800 |
>=120 | 1,000 |
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.
integer
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.
integer
4
... 8192
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'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
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
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
integer
0
... varies
Memory size (MB) | Max value |
---|---|
0 - 3,840 | 30,000 |
3,840 - 7,680 | 85,000 |
7,680 - 15,360 | 200,000 |
15,360 and above | 262,000 |
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.
integer
10
... varies
integer
0
... 2147483647
ms, or -1
to wait forever integer
0
... 2147483647
ms, or -1
to wait foreverinteger
2
... 64
max_logical_replication_workers
. integer
10
... 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.
integer
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
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.
integer
0
... 715827882
8
KBinteger
0
... 715827882
8
KBinteger
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.
integer
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
integer
0
... 2147483647
float
0.0
... 1.0
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
. String
LOG
.log_min_messages
. String
error|apply_remote|keep_local|last_update_wins|first_update_wins
The default is apply_remote
. String
boolean
on
| off
on
. boolean
on
| off
off
. 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
. boolean
on
| off
off
. 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. boolean
on
| off
off
. boolean
on
| off
off
. boolean
on
| off
off
. string
boolean
on
| off
integer
1
... 2147483647
integer
1
... 2147483647
integer
1
... 2147483647
boolean
on
| off
boolean
on
| off
float
0.0
... inf
String
auto|force_generic_plan|force_custom_plan
float
0
... 3
integer
64
... 9192
float
0
... 1
integer
-10
... 10
integer
1
... 20
boolean
on
| off
boolean
on
| off
integer
64
... 9192
integer
64
... 9192
integer
64
... 9192
boolean
on
| off
boolean
on
| off
integer
64
... 9192
integer
64
... 9192
boolean
on
| off
integer
64
... 9192
integer
64
... 9192
integer
1
... 3
integer
64
... 9192
integer
1
... 5
integer
64
... 4096
float
0
... 1
float
0
... 1
integer
0
... 2147483647
enumeration
origin
| replica
| local
float
0.0
... inf
integer
8
KB. 45
GB of instance memory, the default value is 15085
MB. integer
1
... 2147483647
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
KBinteger
1048576
... 2147483647
KB 10262623
KB.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
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.
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.
integer
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.
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 ALTERDATABASEdbnameSETTIMEZONETO'timezone'; ALTERUSERusernameSETTIMEZONETO'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. |
Except 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-04-17 UTC.