From 2e16abf8c0669f7f14d2976eded0fa8e849b5992 Mon Sep 17 00:00:00 2001 From: Aviral Asthana Date: Sun, 30 Aug 2026 14:43:31 +0530 Subject: [PATCH v1] doc: Add multiplier explanation for pg_resetwal -c option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The documentation for the --commit-timestamp-ids (-c) option in pg_resetwal lacked a multiplier explanation, unlike similar options such as --oldest-transaction-id (-u). This made it difficult for users to correctly calculate transaction IDs from pg_commit_ts file names. This patch adds: - Multiplier value (21824 / 0x5540) derived from SLRU_PAGES_PER_SEGMENT, BLCKSZ, and SizeOfCommitTimestampEntry - Concrete example showing file 0007 → 0x25480 - Comment documenting the multiplier formula This resolves the TODO comment asking whether a multiplier should be documented similar to other options. Co-Authored-By: Claude Sonnet 4.5 Claude-Session: https://claude.ai/code/session_01LHazXMxCf8CU4EfiHF91je --- doc/src/sgml/ref/pg_resetwal.sgml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/src/sgml/ref/pg_resetwal.sgml b/doc/src/sgml/ref/pg_resetwal.sgml index 664c525f481..1273e7704c7 100644 --- a/doc/src/sgml/ref/pg_resetwal.sgml +++ b/doc/src/sgml/ref/pg_resetwal.sgml @@ -188,13 +188,18 @@ PostgreSQL documentation A safe value for the oldest transaction ID for which the commit time can be retrieved (first part) can be determined by looking for the numerically smallest file name in the directory - pg_commit_ts under the data directory. Conversely, a safe + pg_commit_ts under the data directory, and then + multiplying by 21824 (0x5540). Conversely, a safe value for the newest transaction ID for which the commit time can be retrieved (second part) can be determined by looking for the numerically - greatest file name in the same directory. The file names are in - hexadecimal. + greatest file name in the same directory, and then multiplying by 21824 (0x5540). + Note that the file names are in hexadecimal. It is usually easiest to specify + the option values in hexadecimal too. For example, if 0007 + is the smallest entry in pg_commit_ts, + -c 0x25480,... will work (the multiplier is represented + by 0x5540 following the 0x7). - + -- 2.34.1