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 1tvKPC-003Xk7-WB for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Mar 2025 18:14:11 +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 1tvKOD-006Crc-Lp for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Mar 2025 18:13:09 +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 1tvKOD-006CrS-CN for pgsql-hackers@lists.postgresql.org; Thu, 20 Mar 2025 18:13:09 +0000 Received: from mail-yb1-xb33.google.com ([2607:f8b0:4864:20::b33]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tvKOA-000BPw-2p for pgsql-hackers@postgresql.org; Thu, 20 Mar 2025 18:13:08 +0000 Received: by mail-yb1-xb33.google.com with SMTP id 3f1490d57ef6-e63c3a53a4cso829146276.2 for ; Thu, 20 Mar 2025 11:13:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742494385; x=1743099185; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=cZ6UjQ0RxRg3Wd/bu7DxVvpyG95FBgFAtcTk9SWS4FI=; b=VaJDcFSaY5y1/vfIfXanVnIDx89hAioz8uXaPAGmejLph27AbfSeP3HbzSLfBKcrNq WD+tkLJOvK0/y2HA0cbBx8vVInWnDimH1HNCC3fai/9QbPnEY8wml4ish5ce9XrcqmKJ c4SscxR/WwLdZmIM/LkFzHWnvQQ/Zdkcmyf+Jo5xBG62XSas/P3M2WOeErGWQQFTrF+l 7nABtkOouE/8aJExj/Qcj9p4YgcDh5JwO5yiRclmtzVWGf+sp8umr4rq1+aKuWytpYSz ZsNlB24DoVMtZ6KBhFuequi/8jxnCwT1O6jAdkFsklFIOFT2TwlYlMY6yx4zc7N9pZ2M SvSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742494385; x=1743099185; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cZ6UjQ0RxRg3Wd/bu7DxVvpyG95FBgFAtcTk9SWS4FI=; b=pAnaB5y/1O10JnctS98nafip3BKYv3qr8mkQftYKqa9lqkYSeyuVbDJ7NdLFp9wG2j Bm5DSJku6uiGzAIPH5yj3AKj6NL5ch8agh8nmG+YuFVeCW7ndXnhP11d0P/k0wwZXH+I j5fHTkwZaDR1oKXgiQxOohYdjH6Xm1Rukz3bmf9eErTuZOCMawTC4TACCndh/9QVe9ah tFudRrlQ0ZRNGf5S2IbND/2PP2Frg/xDTxLkkCjyCH+4gneVCvpFqt1wTYX/naixKk4j b4tyWy46BsKs3LDNUA1GMvoAwD4raP568kj3ltF71bOUMqflyeoCExFS71xGbvg72XY3 UsLw== X-Forwarded-Encrypted: i=1; AJvYcCXkOBuVCr8CtjfZBaMtSFZU72KdssnOJ4H9dc9aqgu6TPLX+/MlR91crMHbMn3zjZHwUpMHNQzimXFh6dUx@postgresql.org X-Gm-Message-State: AOJu0YxtGgjDWYtmh73wtxTaotsDSO6ii+XRoZmVjxw581g0mDkKJJzZ l2WDliU3Ykjl7EmxdujK5Tc1lNJnbCMxk2JmCyD/Vu4LYpdIyy7LDwn9tQ== X-Gm-Gg: ASbGnctsYxEtmnnZgvILng/czej4khVhslbuYQYIv0vHJ07HsSqz1Ayi5TDcWrJi7X5 rDsDg2Rhc/g2xHy3BLg+GYQ3DMRit00BKBH4puZJwqjUhdao/cH00K5e8gkxSWKoqdAHNjv94Ho 2neSuRHyx/PlFyPqycz/30wNcEVqA3gdwDumTMN60G9pitxrKPZy9FaEsPS74BE5ukjrANmEUFi FU+ZCO5MamessTS24vnWxWtiAXhZfKwKtVMU9My+eUotG7004WB4V8d4Z/Hc0WLdYJqmuksu+05 BRyuoLgXWAwCtkx22lS5bSI8K8g4Pe/+MCpacJqz2Fdl78rp5zcbrt+VI8BZ5l5okYIMSlb0S3L ifBGxYkcNdk7Ie2AD3yXIIdLc7lEqtCZ0Tk8= X-Google-Smtp-Source: AGHT+IGK7qpZcOs1Y8CE/XRIsPM8Mk8bAIehX9g0K6KNkxJlPfN2n4UZVAknKL+awtcCZfsQTXx36Q== X-Received: by 2002:a05:6902:274a:b0:e63:4b42:6940 with SMTP id 3f1490d57ef6-e66a4c28ad2mr184404276.2.1742494385300; Thu, 20 Mar 2025 11:13:05 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e66a4223997sm26211276.8.2025.03.20.11.13.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Mar 2025 11:13:04 -0700 (PDT) Date: Thu, 20 Mar 2025 13:13:02 -0500 From: Nathan Bossart To: "David G. Johnston" Cc: Fujii Masao , Robert Treat , Laurenz Albe , Gurjeet Singh , Andres Freund , Will Storey , Robert Haas , Postgres Hackers Subject: Re: Disabling vacuum truncate for autovacuum Message-ID: References: <6f2f2167f4be09e6ca9251c8f69dfe01809d68be.camel@cybertec.at> <88e3b55a-8ef8-4b53-8d71-6bfde1a07bc1@oss.nttdata.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Mar 20, 2025 at 09:59:45AM -0700, David G. Johnston wrote: > I get the need for this kind of logic, since we used a boolean for the > table option, but as a self-proclaimed hack it seems worth more comments > than provided here. Especially pertaining to whether this is indeed > generic or vacuum_truncate specific. It's unclear since both isset and > vacuum_truncate_set have been introduced. I'm happy to expand the comments, but... > If it is now a general property > applying to any setting then vacuum_truncate_set shouldn't be needed - we > should just get the isset value of the existing vacuum_truncate reloption > by name. the reason I added this field is because I couldn't find any existing way to get this information where it's needed. So, I followed the existing pattern of adding an offset to something we can access. This can be used for any reloption, but currently vacuum_truncate is the only one that does. How does something like this look for the comment? /* * isset_offset is an optional offset of a field in the result struct * that stores whether the value is explicitly set for the relation or * has just picked up the default value. In most cases, this can be * deduced by giving the reloption a special default value (e.g., -2 is * a common one for integer reloptions), but this isn't always * possible. One notable example is Boolean reloptions, where it's * difficult to discern the source of the value. This offset is only * used if given a value greater than zero. */ int isset_offset; -- nathan