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 1tvfPl-006uYm-Oo for pgsql-committers@arkaria.postgresql.org; Fri, 21 Mar 2025 16:40:09 +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 1tvfPk-00BRrV-F1 for pgsql-committers@arkaria.postgresql.org; Fri, 21 Mar 2025 16:40:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tvfPk-00BRrN-61 for pgsql-committers@lists.postgresql.org; Fri, 21 Mar 2025 16:40:08 +0000 Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tvfPh-000Lvk-2v for pgsql-committers@lists.postgresql.org; Fri, 21 Mar 2025 16:40:07 +0000 Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-2a01bcd0143so2677289fac.2 for ; Fri, 21 Mar 2025 09:40:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742575203; x=1743180003; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=RMKbr+myCvHWMKGL6G8q7QB3a6JafEomYnFNX+69kLI=; b=lT2bSbwFD0XMbu13I7gasbm3jjTNwmXqM9rusDrgvHQpHPkFO1uu45XPH2IOA+pgvO /qt3p6hdAqg9avSrQGZLLUdIAul0pUuZh03XvWj53eu5ymmk4RIQ1jgIujiY6ZayVeE9 OilEffvpXQsviEk+kypd99hOPInU2apMm2It8nl+iJsjSkt1FEN6j6ByY2W1WZfTbRec iJhnJ63d/a+X75i1ypNpWYeNDYON/MvcHgbQwLqEwXTfqnK5bwKucVeQxFuT0b0R0EQk Smtau/zdjbzzjtU4F8/UzW2w1KYOpfGoxrhgyHKGVyABY0mXDnXzOIdyRkQH/d8CluNb 9AiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742575203; x=1743180003; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RMKbr+myCvHWMKGL6G8q7QB3a6JafEomYnFNX+69kLI=; b=ZHWD13tz8A460P/9puSVxeF0n3GkxyMHD3pMlaDjv+f0TINp9tBBPYssE1MWnkPNWv cDVmmYDxlj5GzgF6eaRqqH5fA/ypw7cg2oLjCZYV/fvkmLdT4m0gM6LOYwtLMndHqSIN BPQvf3tPeVEIJoPMvPh2o38m6uJQWjUgnvGsaXnChi5O1EVGO9RQ5TFFgNLEZZpbja9H ht0m6eeHGXmFBUU1gzmdGH7/6k/wUo6VjG91fK8T+Iu8zN6JTZZdWCn5Qy8mfuzcbmuA fqtL4z9a/sxRdaP6gvsySZ/yYba0dlsRUr/CdQG+PI4WVdRyx/SiZMj43GpyE7s/M3X1 X5yA== X-Forwarded-Encrypted: i=1; AJvYcCVU+pqC02m20cOnrLzbn2KNlstLZpTDrUCCmaCmJvfIfPQf0pXPpzJqnjlSzKIFkrVgifRK/MKeErnrC/PQciVQ@lists.postgresql.org X-Gm-Message-State: AOJu0Yy+sbP2U6Q41LASbQk8G/om4eop/El47bIo1841F3O3zLH42BuN UoMLHtdzidfseO4zYwUzGPpfVw+B2h3/66Yfk+SvgbMEM1dVm+FBmWfzszwFetQ/MmWLoXrBcWM EKtKVJZZqV5UUZlrMLIO/3xE314o= X-Gm-Gg: ASbGnct3IpqydXxxSoYc8jwFznN43gtSACK9Uoqbx/fDjuwpE5DtKlcT50hC2kEa2+U VodakamU62dm+jrx5vPCXAEty+d9YOoqRd2TnNraZUUinNPPkijcyuwfZwtfPZEseyGytw9GeWc HADMr8J70MjUIIm+Q4zIwYf2wQ X-Google-Smtp-Source: AGHT+IFGSMUavExYiTSR9OgHsy+P9lFfYONvqnjwgIs2Gnafip47u5WsmUyta4Jim+966WLhFQ8o8B16wb3zX5luoUs= X-Received: by 2002:a05:6870:f816:b0:29e:4ba5:4ddc with SMTP id 586e51a60fabf-2c7804cbf3emr2825826fac.24.1742575203278; Fri, 21 Mar 2025 09:40:03 -0700 (PDT) MIME-Version: 1.0 References: <993142.1742484654@sss.pgh.pa.us> In-Reply-To: From: "David G. Johnston" Date: Fri, 21 Mar 2025 09:39:26 -0700 X-Gm-Features: AQ5f1JoKN-yWlDu0E71Qh7jF6wt8c_znbP5IV0MRbL5cSeM_OS4reOYJlsR0acg Message-ID: Subject: Re: pgsql: Add vacuum_truncate configuration parameter. To: David Rowley Cc: Tom Lane , Nathan Bossart , pgsql-committers@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000fc69350630dce70b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000fc69350630dce70b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 20, 2025 at 4:07=E2=80=AFPM David Rowley = wrote: > On Fri, 21 Mar 2025 at 04:30, Tom Lane wrote: > > > > Nathan Bossart writes: > > > Since there's presently no way to determine whether a Boolean > > > storage parameter is explicitly set or has just picked up the > > > default value, this commit also introduces an isset_offset member > > > to relopt_parse_elt. > > > > Uh, what? Why is it a good idea to distinguish those states? > > Seems like that risks some very surprising behavior, ie if the > > default is "true", why shouldn't that act exactly like an > > explicit setting of "true"? > > I was thinking about this yesterday as the topic of a > user-configurable options for truncation threshold came up in [1]. I > find it a bit annoying the boolean vacuum_truncate reloption was added > (a few years ago) as we could have instead added a more flexible > truncate_scale_factor that could be set to -1 to disable truncation. > Maybe it's too late now as reloptions are not easy to remove. Adding > this GUC now does put us a bit further down the path of the boolean > option. Not seeing much point in trying to get rid of the on/off switch. It just won't make sense to choose a tunable value of zero to disable something, and probably should be prohibited. I'm seeing an implementation detail discussion here, not a behavior one. The field complaint that we don't let the DBA control this at the GUC level is valid and reasonably solved. The "default" behavior hasn't changed but now instead of hard-coding the default we moved it to a GUC. The storage parameter is no longer documented as having a default, which is correct. It now behaves like most of the other storage parameters in that if unset a GUC provides the value. David J. --000000000000fc69350630dce70b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Mar 20, 2025 at 4:07=E2=80=AFPM David Rowley <<= a href=3D"mailto:dgrowleyml@gmail.com">dgrowleyml@gmail.com> wrote:<= /span>
On Fri, 21 Mar 2025 at 04:30, Tom= Lane <tgl@sss.pg= h.pa.us> wrote:
>
> Nathan Bossart <nathan@postgresql.org> writes:
> > Since there's presently no way to determine whether a Boolean=
> > storage parameter is explicitly set or has just picked up the
> > default value, this commit also introduces an isset_offset member=
> > to relopt_parse_elt.
>
> Uh, what?=C2=A0 Why is it a good idea to distinguish those states?
> Seems like that risks some very surprising behavior, ie if the
> default is "true", why shouldn't that act exactly like a= n
> explicit setting of "true"?

I was thinking about this yesterday as the topic of a
user-configurable options for truncation threshold came up in [1]. I
find it a bit annoying the boolean vacuum_truncate reloption was added
(a few years ago) as we could have instead added a more flexible
truncate_scale_factor that could be set to -1 to disable truncation.
Maybe it's too late now as reloptions are not easy to remove. Adding this GUC now does put us a bit further down the path of the boolean
option.

Not seeing much point in trying to ge= t rid of the on/off switch.=C2=A0 It just won't make sense to choose a = tunable value of zero to disable something, and probably should be prohibit= ed.

I'm seeing an implementation detail discussion= here, not a behavior one.=C2=A0 The field complaint that we don't let = the=C2=A0DBA control this at the GUC level is valid and reasonably solved.= =C2=A0 The "default" behavior hasn't changed but now instead = of hard-coding the default we moved it to a GUC.=C2=A0 The storage paramete= r is no longer documented as having a default, which is correct.=C2=A0 It n= ow behaves like most of the other storage parameters in that if unset a GUC= provides the value.

David J.
--000000000000fc69350630dce70b--