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 1vRc6A-000LvE-29 for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Dec 2025 20:08:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vRc69-009nCL-0k for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Dec 2025 20:08:13 +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.96) (envelope-from ) id 1vRc68-009nCD-32 for pgsql-hackers@lists.postgresql.org; Fri, 05 Dec 2025 20:08:13 +0000 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vRc67-003KoM-0K for pgsql-hackers@postgresql.org; Fri, 05 Dec 2025 20:08:12 +0000 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-3f4f9ea26aaso2008185fac.0 for ; Fri, 05 Dec 2025 12:08:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764965288; x=1765570088; 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=aWd5obriSqK2rhBsCTA9zWMFMp4dGLFxJtLv2iuyhuY=; b=V0lMJ6/3F/TZ0jhPHQy/xp4wlfXbtauZkzsEavHoUeyGwXmRJeOwe6+KVHAVDYkusy rPOjl62cHyEE5l5AQVdkXMlarXPgvYJ6egqGXZNzyghOrZadcx6nDlVOSm2+WyKpsY+y 1HmSKcyUv+uchNdz0g0i8I4dxRT3rFzDhfPmThnDgwM/tGUU4b/ZsMTAHtPc60QaPFbd rVV1hKrLWU2FoVYOoaeqNhmq6HuyvCFA7qUqsw30tGxXKDRPUidHoAazGyGVo+f1wTbz 0wGrm/oIrK5Duk7VAU5kG6bkw5G70he49hH7Rjhj/dSVDImC+jqwakibQOGxf5QYRUm4 gZyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764965288; x=1765570088; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aWd5obriSqK2rhBsCTA9zWMFMp4dGLFxJtLv2iuyhuY=; b=KixKsW2++Axvkhcz6qTGtL5hesBvp6pVItJGfvJfiDsl2cne63arCnZILJotryseYS yvHlKcQVEtuhp1ihSzaMxm1O343d1Ql52PQXyXacHK6tdD0zZmhuzkaoZco7TJcbSO0R fm5fhF0h7G+DssfUQLdjHozFv8CkDcqLlpgDfyfTtsrADFYBmi4T7eE1wRo9PmrbBO5b JcNIRHEk444TKkNobvJ9TlYS2od+Dm1t5yM4HiRze305PqCdC01h9Rf4aR+td8KWr/YO ce+EPAeZa97/EmVXfjE2SUfEYwMfoXwN2uzgoIIAG8LBxMsWLajoWHcdmrKZb2KfBVeI 8kLQ== X-Forwarded-Encrypted: i=1; AJvYcCXMd77cTqITLHen6my6O8aI3c1DB0j6nnI538Tbwr1807mdA3a2g9irxYAntI99u/WeXwoDa6n6NMagC2/+@postgresql.org X-Gm-Message-State: AOJu0Yx2MbJYVbLVy5WAcx9D5pvgT55ysD3AyabSBgYLsgJzni1lTtQ1 WLqScnpMZKVpVc4spBfuOz6yRNkV5O44HSjzjFiMFmPWwzlESGkkLI8M X-Gm-Gg: ASbGncs6XexZgbhDWPW1zDX6CTH+iRz1/y7zh7jVpOQKkhJPFx/i3d2PlRfixFHgYjY 5GaG61Xch+AR5+GxzxrHKgdSLK4jVuuO60HWPNue0NvBigr5Fmjnoj0LDmBKMGIU9lEy6OwrUNp nhgKIdygr+Lok4blC9opjqK7yBFre2HG1+jRA/VDIVSKAOYr0BgFtQJ8Pcm4xxXsTnuqu+a32ej 2+uzQ9mtIyVu5ufFdiKAtz77PcXiFSmmhqFJnBQ1FIlPioBp9UzMHy1eVABeXtIJitsoAVlnE74 6/vTz05neECqy7zwjhJxJ9Wxa6FAjlHrCNyAwnj9tRKDH+/Yp19rXj2opLSfcXTgt1IiRXrMp87 aKsz61eUPco3xILlFEv6aAPV8hw2HbBMA/O99w+A/d49Gcg11WxNG+ehcJY3vf+tE1Ld/10rr59 Wz1iqd1GPzC0bNkjrbtZ1cD8zKSGajfO/ClC7W+zlGozFhf7LPQIJhPlaA/uUngpC2S22jscS5Q dG4TfYREDxFNdg= X-Google-Smtp-Source: AGHT+IEzBs49Lf+E26dSv0y+Hg+OdasEEQNr3zKkBMDL9NM49Yi6Nv339cWwhor25wdbzLAueTJ6gQ== X-Received: by 2002:a05:6871:e266:b0:3ec:3308:f68 with SMTP id 586e51a60fabf-3f543e5900cmr94811fac.8.1764965288449; Fri, 05 Dec 2025 12:08:08 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-3f50b589105sm3958020fac.18.2025.12.05.12.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Dec 2025 12:08:07 -0800 (PST) Date: Fri, 5 Dec 2025 14:08:06 -0600 From: Nathan Bossart To: Kirill Reshke Cc: Corey Huinker , Chao Li , pgsql-hackers@postgresql.org Subject: Re: vacuumdb: add --dry-run Message-ID: References: <3DB353E5-944D-4E18-9DA2-4151F44AA59B@gmail.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 Sat, Dec 06, 2025 at 12:56:22AM +0500, Kirill Reshke wrote: > Hi! Thanks for reviewing. >> + >> + >> + >> + >> + Print, but do not execute, the vacuum and analyze commands that would >> + have been sent to the server (performs a dry run). >> + >> + >> + > > I compared this smgl section to analogous sections of server utilities > (pg_dump, pg_resetwal, pg_rewind), none of them mentions "dry run" in > description of what "--dry run" is. So, I think my feeling is that > this `(performs a dry run).` is unneeded is correct. I borrowed this from pg_archivecleanup's documentation. But to your point, there doesn't seem to be a tremendous amount of consistency in the dry-run options for various utilities. >> - printf(_("%s: vacuuming database \"%s\"\n"), >> - progname, PQdb(conn)); >> + printf(_("%s: vacuuming database \"%s\"%s\n"), >> + progname, PQdb(conn), >> + vacopts->dry_run ? " (dry-run)" : ""); > > I am also not sure we need this change. Look: > > ``` > reshke@yezzey-cbdb-bench:~/pg$ ./bin/bin/vacuumdb --dry-run > vacuumdb: Executing in dry-run mode. > vacuumdb: vacuuming database "reshke" (dry-run) > ``` > > We have two lines which say the same. Well, maybe there is value in > this change, if we are vacuuming multiple databases, but given that > --dry-run produces a lot of > `VACUUM ... -- not executed` output, I think It will be obvious that > this vacuumdb run does not modify the system. WDYT? I guess we could probably remove the top-level "Executing in dry-run mode" message, provided we say the same thing in the per-database message. However, the latter can be turned off with --quiet. Maybe we should consider disallowing --quiet and --dry-run. Overall, I can't claim to have super principled arguments about where I've added these dry-run messages. I kind-of just sprinkled them around. -- nathan