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 1utiIf-00D9Ys-Dq for pgsql-docs@arkaria.postgresql.org; Wed, 03 Sep 2025 07:53:02 +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 1utiIe-007yuj-Lm for pgsql-docs@arkaria.postgresql.org; Wed, 03 Sep 2025 07:53:01 +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 1utiIe-007yuI-DF for pgsql-docs@lists.postgresql.org; Wed, 03 Sep 2025 07:53:00 +0000 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1utiIc-000IFZ-2p for pgsql-docs@lists.postgresql.org; Wed, 03 Sep 2025 07:52:59 +0000 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-61cd6089262so10195700a12.3 for ; Wed, 03 Sep 2025 00:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1756885977; x=1757490777; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=tJKEVuO3DkrBYKDXTuLdVPXto2xLOroW3Qbj71IRCcc=; b=InSuuiGVSIgwEG1OuDvyRbsyMb61CaQrLNsRqqElRUARRd6Ozyj9ft3iTrj5d4g5+J dYPFxxZZWxJnZxgqd+7afhwO0EyhJ1tHsihH0mqMTG1cI5+U5oJRwSH4PDM3YDT9ZACR WSB/TvnfYN48yFErRPpE7xhWCxFhimK/J1yhxI0CMb/BkLwp0s9jwgUXEjqPvjtkyZRc 67PeA3ETlWCEmAbgY3qUUgjzJa5eiB6sGg7oSZilrYHkg9HU/FukciSqfk9vJPfU8qWh CaqpOm/Epv3YvDGt8RauC5EjleYWUMpDGhg7OEe78b9ux/IT1+WxwZ8ZKTij5xdkeg8j X9Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756885977; x=1757490777; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=tJKEVuO3DkrBYKDXTuLdVPXto2xLOroW3Qbj71IRCcc=; b=fTR0WefE3zzJZh/AldJHzIfBk1KNfErJEbMDMmc96Qa/54pLt2XoZ3nxlgFn8+vsaA +iD3ZEQRK8vMYyZWjri9ZSIwkUmpqQ7O5t5Ko4J7WAavaMDbS0XGcdmmaQnR05TNLPEe 1EoRszrUufpJreUE486BSPeEf8GIeTZ5wrfd/Hax273bm1xZqGbw2KTqXppTWOvzkyKX A1GoyKBbb9D/5xfWMH9xBUzlMzR6j5R443V8Y6hvNmC+KeK3I0bdDCsfJHuCYP2ZX4FB c7WSlyx4OaOPbAn0LKKrgsTdBviix/KjSCySv7JyewQTbFjdAF0EUScAN/8M4TQNTIyE DQUA== X-Forwarded-Encrypted: i=1; AJvYcCWb0DNymXKwT7XJcsIZsmjccF6fzLwIL+nUPKbQvBv5Jn/YOmRcEHY7TTWOEx/f5h1TAMJrh9fGmRTW@lists.postgresql.org X-Gm-Message-State: AOJu0YwF4SKHdq/mD8MNF+E6foZ91O5w0PEZg5Ji7lFycleYMmXDoRYl 8v+PmDSmsC+uUbONjCSt1usow441GwjZDSNemNyCnWksWBLMNc2YkkqBL4cHpjX5aXc= X-Gm-Gg: ASbGnctAZnFUB+yn9tM4XDrIhbtZvj83OEJw2faPAOp9w3xtnxQac820yI9FH8dzC/C qtSLF7xSNKr9izYpHJBONZruI3zPwckdwqimkfdgLJ6+zxWdA2TvqH6vivMiFrB/ViFAyzEVRis E+MABN7JhyqAyED1PKs9mZVSoVZVQCQCvYWyxzryIzAxa5PpHQMS3afiEJeZf7rZjjdH+5egs6H SDUe765ZumRlFchE7/F8Tqeu4mrFD9kaTlLdOYvY4Ztco739dfxQwpZH2LgEkr5ytY0J5++xTx6 nk+2hHTR5Fnadd4QOBNCYThfCjLDdjf5/KUOSEWKuCDoE63KnkeRbFEYS0FK6wO9+w6zJZkqabb z6gDQmTgMRixh6TFvb+kTrIXnoJa2gEl12t9QKmBklMrhHx4Eit7TFQ== X-Google-Smtp-Source: AGHT+IFEYlZzgy3q2hBJT5ZLdK3OAH6KCiZtF0CJAyGyr3aRLQdcpgH4POGnHR3D6JjDOMUv0pi/Wg== X-Received: by 2002:a05:6402:90c:b0:61b:ff85:398b with SMTP id 4fb4d7f45d1cf-61d268930c3mr11705508a12.14.1756885977213; Wed, 03 Sep 2025 00:52:57 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:260:4d40:896e:d702:196e:5a83]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-61cfc5572afsm11406893a12.50.2025.09.03.00.52.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Sep 2025 00:52:56 -0700 (PDT) Message-ID: <676bd6741c0ea1195b8d65231edb96eeee5f9cc7.camel@cybertec.at> Subject: Re: Minor necessary/sufficient slip-up? From: Laurenz Albe To: knut.b.haus@gmail.com, pgsql-docs@lists.postgresql.org Date: Wed, 03 Sep 2025 09:52:56 +0200 In-Reply-To: <175680133226.771.1421809976333381466@wrigleys.postgresql.org> References: <175680133226.771.1421809976333381466@wrigleys.postgresql.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-1.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2025-09-02 at 08:22 +0000, PG Doc comments form wrote: > Page: https://www.postgresql.org/docs/17/routine-vacuuming.html >=20 > This is a most pedantic point, but since the postgres documentation is > incredibly accurate and well written I indulge my pedantry this one time: >=20 > 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 a= lso > sufficient. Indeed if I understand the subsequent explanation, it is > sufficient but not necessary. >=20 > Here is the full paragraph: >=20 > 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 =E2=80=9Cin the future=E2=80=9D and= should not be > visible to the current transaction. But since transaction IDs have limite= d > size (32 bits) a cluster that runs for a long time (more than 4 billion > transactions) would suffer transaction ID wraparound: the XID counter wra= ps > around to zero, and all of a sudden transactions that were in the past > appear to be in the future =E2=80=94 which means their output become invi= sible. In > short, catastrophic data loss. (Actually the data is still there, but tha= t'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. >=20 > Suggested change for the last sentence: > To avoid this, it suffices to vacuum every table in every database at lea= st > once every two billion transactions. I don't think that that would be an improvement. Yes, it is sufficient, bu= t 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? Yours, Laurenz Albe