From f4f229b4f16cfb674950e08f213dc64d854c980d Mon Sep 17 00:00:00 2001 From: "David G. Johnston" Date: Wed, 4 Mar 2026 08:04:42 -0700 Subject: [PATCH v1] doc: Add some clarity around wal_level --- doc/src/sgml/config.sgml | 51 ++++++++++++--------------- doc/src/sgml/logical-replication.sgml | 7 ++-- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index f670e2d4c31..406518aae63 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -3072,15 +3072,21 @@ include_dir 'conf.d' - wal_level determines how much information is written to - the WAL. The default value is replica, which writes enough - data to support WAL archiving and replication, including running - read-only queries on a standby server. minimal removes all - logging except the information required to recover from a crash or - immediate shutdown. Finally, - logical adds information necessary to support logical - decoding. Each level includes the information logged at all lower - levels. This parameter can only be set at server start. + wal_level determines the minimum amount of information + that is to be written to the WAL. The default, and middle, value is + replica, which writes enough data to support + WAL archiving (see ) and + physical replication (see ) + Running read-only queries on a standby server. Below that is minimal, + which removes all logging except the information required to recover from a crash or + immediate shutdown. Finally, above replica, is logical, + which adds information necessary to support logical decoding and + logical replication (see ). + Each level includes the information logged at all lower levels. + The parameter reports the actual + level used by the system. Namely, whether replica has been promoted to + logical (minimal never promotes). + This parameter can only be set at server start. The minimal level generates the least WAL @@ -3117,17 +3123,6 @@ include_dir 'conf.d' many UPDATE and DELETE statements are executed. - - It is important to note that when wal_level is set to - replica, the effective WAL level can automatically change - based on the presence of - logical replication slots. The system automatically increases the - effective WAL level to logical when creating the first - logical replication slot, and decreases it back to replica - when dropping or invalidating the last logical replication slot. The current - effective WAL level can be monitored through - parameter. - In releases prior to 9.6, this parameter also allowed the values archive and hot_standby. @@ -11945,17 +11940,17 @@ dynamic_library_path = '/usr/local/lib/postgresql:$libdir' system. This parameter shares the same set of values as , but reflects the operational WAL level rather than the configured setting. For descriptions of - possible values, refer to the wal_level + possible values, refer to the parameter documentation. - The effective WAL level can differ from the configured - wal_level in certain situations. For example, - when wal_level is set to replica - and the system has one or more logical replication slots, - effective_wal_level will show logical - to indicate that the system is maintaining WAL records at - logical level equivalent. + Presently, on primary servers, differences from + only happen when is set to replica. + Based on the presence of + logical replication slots, the system automatically increases the + effective WAL level to logical when creating the first + logical replication slot, and decreases it back to replica + when dropping or invalidating the last logical replication slot. On standby servers, effective_wal_level matches diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml index 5028fe9af09..c709224de0a 100644 --- a/doc/src/sgml/logical-replication.sgml +++ b/doc/src/sgml/logical-replication.sgml @@ -3508,11 +3508,12 @@ pg_ctl -D /opt/PostgreSQL/data2_upgraded start -l logfile Quick Setup - First set the configuration options in postgresql.conf: + Ensure that is at least replica + (this is the default). -wal_level = logical +SHOW effective_wal_level; - The other required settings have default values that are sufficient for a + The other required settings also have default values that are sufficient for a basic setup. -- 2.43.0