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 1utkGD-00DW70-2N for pgsql-docs@arkaria.postgresql.org; Wed, 03 Sep 2025 09:58:38 +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 1utkGC-008hrc-03 for pgsql-docs@arkaria.postgresql.org; Wed, 03 Sep 2025 09:58:36 +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 1utkGB-008hrS-CC for pgsql-docs@lists.postgresql.org; Wed, 03 Sep 2025 09:58:36 +0000 Received: from fhigh-a4-smtp.messagingengine.com ([103.168.172.155]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1utkGA-000JKA-06 for pgsql-docs@lists.postgresql.org; Wed, 03 Sep 2025 09:58:34 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id 922411400414; Wed, 3 Sep 2025 05:58:33 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Wed, 03 Sep 2025 05:58:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1756893513; x=1756979913; bh=i+G3UKqYJbZ1qOgFFHoV0GP5hX8tsWPzNdQoj8FCx1M=; b= esKtwDyHJdzqKABRBrJFiesGkAY2py6UerQeUC+vYKHO7tAvqm9Fvb+mDGfmQtqq 8xg6tQ7pnrTtsGfR1M7IR15WV/KURpQkcGcXOLt2KMYADGsF0BssFrlJ4BtasnSx YCfhHMG0dHmsS7AVlYv0uXtEYOD8u832nfewFP8aoXHNG0lDtEEYrl4IOnSva80I he1Rbv1UiAHcQyKQmwoQPFHQWvIDzbQRlVJRgRI1dagrw6SW6/EHRUzb/zkLkHAi lvwM1qHXm39zguvYPPWFt8PBzl7fvo7XsAwPIb4iPP7kDGKZX7CKOY7SBQY6AXTB SO2QoF1C2tXg16EhgX0xgg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1756893513; x=1756979913; bh=i +G3UKqYJbZ1qOgFFHoV0GP5hX8tsWPzNdQoj8FCx1M=; b=AqB59UcNwbvtBNdIO DRxske4e6CIrwdOHkixY4Xf6ZtaYKPBIc/3JR+kpSU3sOfJbDojpRVKMJqbaawtE yvsbVZLRkZXGm2jg3gfXBZrrxcBh3Z+mHqW5PVb5gTPCV4kFhR5FWaztDjK+YtDK AebcPF/nLc9MYO7QlmFOgCAt0JXVkkqHeN8gCRwEL2kIL3og83/wJOjuxu1S8Fwy /2lzFbnK9SaQmwAprnxwuVke8t6LOCD4BhAe8Xr/6eHeN3GL6sYFAqvsK+vuv9A0 ApHp83HOtty0A+WT3Rfs9BVO6sU6jnR/Ej8uwqF7TOFbtxYiS98+9Tfw7hgV20Q5 zK15g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh epkfffgggfuffvfhfhjggtgfesthekredttddvjeenucfhrhhomheprfgvthgvrhcugfhi shgvnhhtrhgruhhtuceophgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgqeenucggtf frrghtthgvrhhnpeffueetudelgeejiedujefgteehhfdtudekhedthedtgedugffhtdev udegudduieenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhesvghishgv nhhtrhgruhhtrdhorhhgpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuth dprhgtphhtthhopehlrghurhgvnhiirdgrlhgsvgestgihsggvrhhtvggtrdgrthdprhgt phhtthhopehknhhuthdrsgdrhhgruhhssehgmhgrihhlrdgtohhmpdhrtghpthhtohepph hgshhqlhdqughotghssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Sep 2025 05:58:32 -0400 (EDT) Message-ID: <278b0a93-78df-498b-9284-162230e7db90@eisentraut.org> Date: Wed, 3 Sep 2025 11:58:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Minor necessary/sufficient slip-up? To: Laurenz Albe , knut.b.haus@gmail.com, pgsql-docs@lists.postgresql.org References: <175680133226.771.1421809976333381466@wrigleys.postgresql.org> <676bd6741c0ea1195b8d65231edb96eeee5f9cc7.camel@cybertec.at> Content-Language: en-US From: Peter Eisentraut In-Reply-To: <676bd6741c0ea1195b8d65231edb96eeee5f9cc7.camel@cybertec.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 03.09.25 09:52, Laurenz Albe wrote: > On Tue, 2025-09-02 at 08:22 +0000, PG Doc comments form wrote: >> Page: https://www.postgresql.org/docs/17/routine-vacuuming.html >> >> This is a most pedantic point, but since the postgres documentation is >> incredibly accurate and well written I indulge my pedantry this one time: >> >> Regarding the last sentence of the first paragraph of 24.1.5: I sure hope >> vacuuming every table in every database at least once every two billion >> transactions is not only necessary to avoid catastrophic data loss, but also >> sufficient. Indeed if I understand the subsequent explanation, it is >> sufficient but not necessary. >> >> Here is the full paragraph: >> >> 24.1.5. Preventing Transaction ID Wraparound Failures >> PostgreSQL's MVCC transaction semantics depend on being able to compare >> transaction ID (XID) numbers: a row version with an insertion XID greater >> than the current transaction's XID is “in the future” and should not be >> visible to the current transaction. But since transaction IDs have limited >> size (32 bits) a cluster that runs for a long time (more than 4 billion >> transactions) would suffer transaction ID wraparound: the XID counter wraps >> around to zero, and all of a sudden transactions that were in the past >> appear to be in the future — which means their output become invisible. In >> short, catastrophic data loss. (Actually the data is still there, but that's >> cold comfort if you cannot get at it.) To avoid this, it is necessary to >> vacuum every table in every database at least once every two billion >> transactions. >> >> Suggested change for the last sentence: >> To avoid this, it suffices to vacuum every table in every database at least >> once every two billion transactions. > > I don't think that that would be an improvement. Yes, it is sufficient, but > it is also necessary. And the "necessary" part is the more important one. > As reader, I would implicitly assume that VACUUM is sufficient, otherwise > the nice writers of the documentation would surely have told me what else I > have to do to avoid that scary eventuality. > > I'd be OK with writing "necessary and sufficient". Or is that too much > legalese? I think this introductory sentence establishes the necessity only. The rest of the section and chapter establishes the sufficiency.