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 1tt7Ar-008n0k-Kh for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Mar 2025 15:42:13 +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 1tt7Aq-00AU2s-AZ for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Mar 2025 15:42:12 +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 1tt7Aq-00AU2k-0n for pgsql-hackers@lists.postgresql.org; Fri, 14 Mar 2025 15:42:12 +0000 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tt7Ao-002pKT-0i for pgsql-hackers@postgresql.org; Fri, 14 Mar 2025 15:42:11 +0000 Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-471fe5e0a80so19339431cf.1 for ; Fri, 14 Mar 2025 08:42:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741966929; x=1742571729; 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=DSvllgVojsxLkYNEoWSdS/BpS4HzS4u8iiC4bsY8wXY=; b=A5JWkfEOsFoJmugS0GfMFnTfhGKihTAmiqoNXZ2x0qC42pwAv0oWdlJFizJ2ZgvHuF g1SFQy20r3hbL4BkGyHFb97y/kXd2R1ii0f0YovitRqupkhxNOofi/ApebvtiZU9SZbK lCVsDcUg0MsrKVjn9/Cip1Milj4viuE9Sgf7d8Q4k/Uh+EED6BakH6+2YkW6cIwxVJLu LYQLOsQnbnC1nJQ8VdirwaAXqX/ZQwy8I8vojfBFtAgU9j6vSokbfFrUK1TAOXc5zs73 TXnOXFtLfaGsS3FfOZz+ZdeVGtKTm2/F5Y1M/PYi0XZFfj1X8cX9J5wJfVC9qi1ySjR4 H5Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741966929; x=1742571729; 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=DSvllgVojsxLkYNEoWSdS/BpS4HzS4u8iiC4bsY8wXY=; b=Gi7zVE/vG1zQgzygF/3DMgWofw78FG0QdPr3v97LxTUDr3IaXAigagh8sKJuR3W4Pf aYQRqBYf9Drgaj8fwleomoRoPVxlTCnjdVi5ryuKgcc9ePmnkFgaGL8PDy7mOx32MOcj lcPCintZL8Eibno01oKKJpQ2tcV5mHPera7Y8SsSLaDELwndyep39pRotvZznzmdTFw9 qbpn3+hKWURp/zFfepFBUBk89BH9FCbvVsREDJEewdzSFlZdwYToRH/shRghiOI5BEcH cqCJsUXN52IyeZeSEaLd88pKb5thPu34Jib0Ts84LbJ6VtMlvawX3W/DXsU+vFvvIFk2 4Qmw== X-Forwarded-Encrypted: i=1; AJvYcCWS2ah0lMrKwwsymPYm2szPKx0zw3ZUAaHTzqs0O8tCOkWs8Y0EqqABmrBVsTXWAo7IeOXRzJE3hNEvaDfp@postgresql.org X-Gm-Message-State: AOJu0YzHexcF37DLD0feCJksVyxpzM0uSVK+NP3vhxodS7TczkJIoib7 JHcKPh4812IcuEUCQaU+n091JX1irZXcQfI48nrVwHDos+lVPOfn X-Gm-Gg: ASbGnctbmSRbjQbRNvvJ0eqOfsn34PelrZ4XLuA2ZwlKhW/xeBcHylZgO5Lf6e5OQe1 368dYXukudPvfhHjotVJzgUSrlq+NlXV2bPtlgO8MoO95IOJSfPCax1WhaIHOVMRfUbyiuKcMY8 yy7FEjjxXfBoFNIm6oGYYa71fI8B/JMbSY/obu41Xr0pkR/6Ei8GgVbBTri1nK1nRcCDoWWGN4Y xZfbegffyOk4eD7eidEbB/ubCVaeBMQ/Twp5l7pd1S55xIaN/kACW5MNf5lAD6M79fgxMY4Qm/f ug989aHqcFeL77BLxUN0fSgKX2QTQetFTU5Ez6tFRhjMVGrNgz09ourZwIcmYLM6X9GLjT/fUrW uPOSSKHlXmAStfiu1VY4fzq9kvX929DNQ6NxNSLpA9ldXgQ== X-Google-Smtp-Source: AGHT+IEB1Oyiz83ueFkzkIdvgEuv3DpsRV/ItbX2qOJJAqpMBKKpZw8BHYCVgqjmgCZOE2VRhBmqmQ== X-Received: by 2002:a05:622a:500a:b0:476:8028:71ce with SMTP id d75a77b69052e-476c810fa19mr43608391cf.3.1741966929589; Fri, 14 Mar 2025 08:42:09 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-476bb7f21d9sm25095601cf.49.2025.03.14.08.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 08:42:09 -0700 (PDT) Date: Fri, 14 Mar 2025 10:42:07 -0500 From: Nathan Bossart To: Fujii Masao Cc: Gurjeet Singh , Robert Haas , Laurenz Albe , Postgres Hackers , Will Storey Subject: Re: Disabling vacuum truncate for autovacuum Message-ID: References: <28773a66-fb88-41cf-a7ec-4216e6c91c94@oss.nttdata.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <28773a66-fb88-41cf-a7ec-4216e6c91c94@oss.nttdata.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Mar 06, 2025 at 08:54:59AM +0900, Fujii Masao wrote: > +1 to having the reloption (if specified) override the GUC setting. > That is, I think that autovacuum_vacuum_truncate as defining > the default behavior for VACUUM truncation, and that the GUC should > only apply when neither the TRUNCATE option in VACUUM nor > the reloption is set. One other difference in my version of the patch [0] is to call this GUC vacuum_truncate and have it apply to both autovacuum and VACUUM. I did this for the following reasons: * There is no autovacuum-specific storage parameter. There is only vacuum_truncate and toast.vacuum_truncate, both of which apply to autovacuum and VACUUM. Unfortunately, adding autovacuum-specific storage parameters at this point would break things for folks who are already using vacuum_truncate to prevent autovacuum from truncating. In any case, I gather that we try to ordinarily keep storage parameters named the same as their corresponding GUCs. * I'm not sure whether there's a real need to control the autovacuum default but not the VACUUM one. I'd expect most users of this stuff to be worried about truncation in both cases, especially for the hot standby use-case mentioned upthread. I should also mention that we just have a few weeks left in the v18 development cycle. The code itself seems pretty straightforward, so if we can agree on behavior and nomenclature, I'll do my darndest to get this responsibly committed in time. [0] https://postgr.es/m/attachment/172951/v2-0001-Add-vacuum_truncate-GUC.patch -- nathan