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.94.2) (envelope-from ) id 1sRYyY-00GWnA-DG for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jul 2024 15:11:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sRYyW-006I1Z-3v for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jul 2024 15:11:20 +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.94.2) (envelope-from ) id 1sRYyV-006I1R-QP for pgsql-hackers@lists.postgresql.org; Wed, 10 Jul 2024 15:11:19 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sRYyT-001OAp-7j for pgsql-hackers@lists.postgresql.org; Wed, 10 Jul 2024 15:11:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 46AFBDP01744273; Wed, 10 Jul 2024 11:11:13 -0400 From: Tom Lane To: Jelte Fennema-Nio cc: Nathan Bossart , Robert Haas , Fujii Masao , pgsql-hackers@lists.postgresql.org Subject: Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal In-reply-to: References: <6e30082e-041b-4e31-9633-95a66de76f5d@oss.nttdata.com> <802ff3d5-fdc7-4b08-9046-2e9fc5fdae0e@oss.nttdata.com> <7c1b48d8-0f08-4733-a4e6-d55f04581db7@oss.nttdata.com> Comments: In-reply-to Jelte Fennema-Nio message dated "Wed, 10 Jul 2024 16:29:14 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1744271.1720624273.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 10 Jul 2024 11:11:13 -0400 Message-ID: <1744272.1720624273@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jelte Fennema-Nio writes: > On Wed, 10 Jul 2024 at 16:18, Nathan Bossart = wrote: >> Yeah. I initially thought this patch might be okay, at least as a stop= gap, >> but Jelte pointed out a case where it doesn't work, namely when you hav= e >> something like the following in the config file: >> = >> wal_level =3D 'minimal' >> summarize_wal =3D 'true' >> wal_level =3D 'logical' > I think that issue can be solved fairly easily by making the guc > check_hook always pass during postmaster startup (by e.g. checking > pmState), and relying on the previous startup check instead during > startup. Please, no. We went through a ton of permutations of that kind of idea years ago, when it first became totally clear that cross-checks between GUCs do not work nicely if implemented in check_hooks. (You can find all the things we tried in the commit log, although I don't recall exactly when.) A counter-example for what you just said is when a configuration file like the above is loaded after postmaster start. If we want to solve this, let's actually solve it, perhaps by inventing a "consistency check" mechanism that GUC applies after it thinks it's reached a final set of GUC values. I'm not very clear on how outside checking code would be able to look at the tentative rather than active values of the variables, but that should be solvable. regards, tom lane