Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wAJJd-002GB7-2p for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2026 03:10:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAJJa-004JuN-04 for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2026 03:10:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wAJJZ-004JuF-1x for pgsql-hackers@lists.postgresql.org; Wed, 08 Apr 2026 03:10:50 +0000 Received: from mail-yx1-xb129.google.com ([2607:f8b0:4864:20::b129]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wAJJX-000000019Jt-22H9 for pgsql-hackers@lists.postgresql.org; Wed, 08 Apr 2026 03:10:48 +0000 Received: by mail-yx1-xb129.google.com with SMTP id 956f58d0204a3-6500eae6d2fso5801327d50.1 for ; Tue, 07 Apr 2026 20:10:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775617847; cv=none; d=google.com; s=arc-20240605; b=HUMLQKy21yW8dUX4W/Xi1e0ZzkAdSJck13fNCHRun5BtXBWlGRxN5uYRfMtLYyeJhb B6gC77PyLVX66DLyW9NeMEVkL848eP0AkaLQ537G/aXa0QyBULBtF3j9eczWRjdDGP0C MccN1OL35lEZJhRuL9oiLHx1YxQCm5S6QaVJ8065wm0yK2C4hYvyQonQa7LhwaDQw5l3 9SOJMvGsLUId5oVjSyjQrGApe7eJSZjY3mujNyKVatpLTITg2+BT52JkhCKgOQBSI912 meBoxMKOJtQwMBnoYVoxqqG81sZl2sJ08S921YLY6t9vplclw/XXcw8mzT21l4T8HmhZ TuAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:dkim-signature; bh=4k3VHeQBCJGCD36FrV7nJKEDgQd1TIN4xQFrxPEacLg=; fh=difWPyZhf+FMfWnUHiBJsrLSKQJL23D1+3HP+YAZNos=; b=hDXrqgtPVFTaC6l9sdXhTso1Rc3GO/njpnGKyGk3DwTjENZrPSxMx/mSdJTV3hItah H4o+6p045oab0Z5HHpNGqVyTz0p8cabdJdLvdaIcrvt5p/EPJrLKMVP4pqpeBHkAOrU1 79z6H7qWfiSZ8hLeDbvC0zeQFslwzJZf9GycWpU/C26Y3PYeDjD+yigG/eQZqbqwOu/6 OrLC4kjhmDuL8CpOV3mSsBPnjMPHzo13JqQYJa3tCMCq7pibvxYHv7A7RwkfLlzlBvVr 1ncxgHVQRxD1y6RvFVkXT1Zpr/0NQHN4zmwAZ5ojyyybJKB7TpUyuJF7Jxit5e8qDSK9 W+FA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775617847; x=1776222647; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=4k3VHeQBCJGCD36FrV7nJKEDgQd1TIN4xQFrxPEacLg=; b=KHWJhgfaPnO+Ga6hz/ld4wwtarTcEMDaMhZ3CS5EAkppIwv1vEhwFIcGdbNRLwRXUw pv8EyoAyEdkig6/oXvDs978NApT5rl0aTAstLjlAkID/jzyb1svbzMsV2RanCEDHU/gY I8mS/+xIibFy84jDcP+3pntncfnR4f37qSzrjNVIviphVpwRZexOIc+l/CtUR0GVEV6m 86p00WZmXEpvwPuD0m+XRdYxdL2C8ebRDGBNQt4Bs23PTaXLzBGVqp2HuzdOajcMEi/9 AbaRVnJCVXYi+jyf4aKyoxm7rV/5Qu4L3NycyNPGlJQAiDkw+k4fH+m6ELrhOrHVp83V IPFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775617847; x=1776222647; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4k3VHeQBCJGCD36FrV7nJKEDgQd1TIN4xQFrxPEacLg=; b=OK8cCQY5oHdOiycfulE/v3ivbboNWqcGtJNUcot0TWlBNseuG2Uk0iI09k5GzbpxU+ w+/pdEtjYqA2Dawxz11qOWJ3NGGKpp+ozN9Zf+LiPS0GkO+Qt47mToG7vCY94QRbI3Ts UkjbepyoyBF364rhsESz6MRVhgTcQbCpVJCiG5GOLLDX0KbOGJ4tdEwfDQRACzhMpWtH lV5wkd/8Qo98gECogQUw6tYVEz8J3LgzrM9aiW3vo4YRiswIqynyApY6fhld02sm6lRq CAocMa9S+LKBPQjcF55fikhZn49k2K0Gp1jmilZ5OCcC2Ib50qDOuOFKf18PEHhVrRwr 2qTw== X-Gm-Message-State: AOJu0Yw5/Y8ihathcQeccup9O9EhJSq4OM11mrAhty9l/9KWscUt+f3D C+wx8hTNlAU8e/TlHlBKudd6/8FohOghbAS1Fx6KLWYYURTYI377/cBu8EQEyw7nXp4VDt+fDZ7 a/cT76lAAW2tVxDQ7TLSXz/MWAZwpgBw= X-Gm-Gg: AeBDietdhtVKaE0Fa1BoIjcucUKwWajV5cg3b4Jc6AEyR9V9pDXH2IvpIS7+O0RIcqq eAXwKDiLJwDxrMnCLXyTZbUXbWqvvbntQdeVs0S5jbitX12LWwd2Gbp6rDhn9v1ocTPJ9gaO7Rg 3wZwQll1VdHQC9yklOXXYWtyPa9FLusQked+axjJ19XZOH5lpaqaUH80DMHAsuaPL+Eo4DWqePR WzOrU8c8JGK4cLeKoPlcrn2W1S+Lz6ankRoxk7TJUAysyKMlVnZeaZAy/oS/4ShZCAFtP9DfQa1 hYnLQSql X-Received: by 2002:a05:690e:154a:20b0:650:337a:1afd with SMTP id 956f58d0204a3-6504880fbd4mr14577812d50.38.1775617846777; Tue, 07 Apr 2026 20:10:46 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:7010:1548:b0:514:ce4:ecb1 with HTTP; Tue, 7 Apr 2026 20:10:45 -0700 (PDT) In-Reply-To: <33F33315-9A7D-41A2-9F37-0A361E5A4C7F@gmail.com> References: <33F33315-9A7D-41A2-9F37-0A361E5A4C7F@gmail.com> From: "David G. Johnston" Date: Tue, 7 Apr 2026 20:10:45 -0700 X-Gm-Features: AQROBzAgASMz1QnirpepuHISWhkgjneBdbUrl2xnElV4rKXjbHhuejS0T-ZrqCA Message-ID: Subject: doc: Improve wal_level and effective_wal_level GUC around logical replication To: Chao Li Cc: PostgreSQL Hackers Content-Type: multipart/alternative; boundary="00000000000003a2a2064eea3fa1" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000003a2a2064eea3fa1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tuesday, April 7, 2026, Chao Li wrote: > > > On Mar 4, 2026, at 23:55, David G. Johnston > wrote: > > > > Hi, > > > > In evaluating the proposed change to wal_level docs in [1] I found it t= o > be undesirable, but the discussion and my own review discovered some othe= r > changes that should be considered. > > > > Since effective_wal_level now exists, Logical Replication Getting > Started needs to be updated. > > Add links to the main topics that the different levels apply to. > > Be explicit about the ordering of minimal, replica, and logical. > > Move the behavior of effective_wal_level to the GUC for it, leaving > behind just the pointer that wal_level is now just a "minimum". > > > > David J. > > > > [1] https://www.postgresql.org/message-id/CA%2Bv5N42vKtY17653eBH > Fx%2BCw06E2fSmPrXmX2qKYG23%3D4Ycd7A%40mail.gmail.com > > > > > A few comments: > > 1 > ``` > --- 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 ename>: > + Ensure that is at least > replica > + (this is the default). > > -wal_level =3D 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. > > ``` > > I think wal_level should be at least =E2=80=9Clogical=E2=80=9D. I don=E2= =80=99t get why did you > change to =E2=80=9Creplica=E2=80=9D? It=E2=80=99s clear that we still nee= d =E2=80=9Clogical=E2=80=9D to support > logical replication. A minimum setting of replica is automatically interpreted (i.e., effective WAL level) as logical when necessary so the default setting of replica doesn=E2=80=99t need to be changed anymore. Seeing replica in effective WA= L level means no logical replication has been setup and the dba hasn=E2=80=99t redu= ced the system to minimal. If one sees logical there, that works too. > 2 > ``` > + 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, > ``` > > Here, =E2=80=9CRunning read-only =E2=80=A6=E2=80=9D sentence looks not sm= ooth, and there is not a > period for the last sentence before =E2=80=9CRunning". The old wording wa= s > =E2=80=9Cincluding running read-only =E2=80=A6.=E2=80=9D. > Yeah, I still stand by the whole of it but need to do another pass. I do get that there likely wasn=E2=80=99t any ambiguity - even presented re= plica, minimal, logical - as to which was highest/middle/lower and being explicit here maybe seems overly verbose. Also, I added a qualifier regarding =E2=80=9Cprimary servers=E2=80=9D but a= m now unsure why. Kinda concerned about logical where publisher and subscriber are not mutually exclusive. --00000000000003a2a2064eea3fa1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tuesday, April 7, 2026, Chao Li <li.evan.chao@gmail.com> wrote:
> On Mar 4, 2026, at 23:55, David G. Johnston <david.g.johnston@gmail.com>= ; wrote:
>
> Hi,
>
> In evaluating the proposed change to wal_level docs in [1] I found it = to be undesirable, but the discussion and my own review discovered some oth= er changes that should be considered.
>
> Since effective_wal_level now exists, Logical Replication Getting Star= ted needs to be updated.
> Add links to the main topics that the different levels apply to.
> Be explicit about the ordering of minimal, replica, and logical.
> Move the behavior of effective_wal_level to the GUC for it, leaving be= hind just the pointer that wal_level is now just a "minimum".
>
> David J.
>
> [1] https://www.postgresql.org/message-id/CA%2Bv5N42vKtY17653eBHFx%= 2BCw06E2fSmPrXmX2qKYG23%3D4Ycd7A%40mail.gmail.com
> <v1-0001-doc-Add-some-clarity-around-wal_level.patch>


A few comments:

1
```
--- 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 l= ogfile
=C2=A0 =C2=A0<title>Quick Setup</title>

=C2=A0 =C2=A0<para>
-=C2=A0 =C2=A0First set the configuration options in <filename>postgr= esql.conf</filename>:
+=C2=A0 =C2=A0Ensure that <xref linkend=3D"guc-effective-wal-level"/> is at least replica
+=C2=A0 =C2=A0(this is the default).
=C2=A0<programlisting>
-wal_level =3D logical
+SHOW effective_wal_level;
=C2=A0</programlisting>
-=C2=A0 =C2=A0The other required settings have default values that are suff= icient for a
+=C2=A0 =C2=A0The other required settings also have default values that are= sufficient for a
=C2=A0 =C2=A0 basic setup.
=C2=A0 =C2=A0</para>
```

I think wal_level should be at least =E2=80=9Clogical=E2=80=9D. I don=E2=80= =99t get why did you change to =E2=80=9Creplica=E2=80=9D? It=E2=80=99s clea= r that we still need =E2=80=9Clogical=E2=80=9D to support logical replicati= on.

A minimum setting of replica is automat= ically interpreted (i.e., effective WAL level) as logical when necessary so= the default setting of replica doesn=E2=80=99t need to be changed anymore.= =C2=A0 Seeing replica in effective WAL level means no logical replication h= as been setup and the dba hasn=E2=80=99t reduced the system to minimal.=C2= =A0 If one sees logical there, that works too.


2
```
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 <literal>replica</literal>, which = writes enough data to support
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 WAL archiving (see <xref linkend=3D"co= ntinuous-archiving"/>) and
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 physical replication (see <xref linkend=3D&= quot;streaming-replication"/>)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Running read-only queries on a standby server.= Below that is <literal>minimal</literal>,
```

Here, =E2=80=9CRunning read-only =E2=80=A6=E2=80=9D sentence looks not smoo= th, and there is not a period for the last sentence before =E2=80=9CRunning= ". The old wording was =E2=80=9Cincluding running read-only =E2=80=A6.= =E2=80=9D.

Yeah, I still stand by the whole of it but= need to do another pass.

I do get that there like= ly wasn=E2=80=99t any ambiguity - even presented replica, minimal, logical = - as to which was highest/middle/lower and being explicit here maybe seems = overly verbose.

Also, I added a qualifier regardin= g =E2=80=9Cprimary servers=E2=80=9D but am now unsure why.=C2=A0 Kinda conc= erned about logical where publisher and subscriber are not mutually exclusi= ve.


--00000000000003a2a2064eea3fa1--