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 1w8RhX-000XTQ-0l for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Apr 2026 23:43:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w8RhW-008oqz-0A for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Apr 2026 23:43:50 +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.96) (envelope-from ) id 1w8RhV-008onf-22 for pgsql-hackers@lists.postgresql.org; Thu, 02 Apr 2026 23:43:50 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w8RhU-00000000GUD-0Kjh for pgsql-hackers@lists.postgresql.org; Thu, 02 Apr 2026 23:43:49 +0000 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-66bb6eb28acso2702540a12.0 for ; Thu, 02 Apr 2026 16:43:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775173425; cv=none; d=google.com; s=arc-20240605; b=ZkAyOwyk6v6fQBsaHcmEZlCeOa5gbZ2dGEMdSn8Hm/jriEZHPLVfnEu82gL/C0EqQR y48IkP9UI4NMjH/JcOQEVxO99oEhkHLvvjettqg914gSY7Nuvjq01ww7QKC8NBaZsZj1 r0kbcxXYO9WNkFJRdAPtTyYJmyAwtxYVDpvvIUcF9aMewn3ha1h00CZGSlnRMutLAp4b ew/LHHQbJun8KPf3flC7Q/0YrlzZlpZyZ4vSLwdM92ziiFkAELTpYFSTzprPU79AbGDh ZA7emKCCZqzlv+deL82LTGy/a7KGg9HQdsTsuJOP0aD/RvBccUorhR1UfVz/0tY8PoB9 yosQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=oEqWXZUZugakXPie80dPKHF7fN6jjN6YPQqVvO72NAI=; fh=V1l8OMH4aAGHeVZcjy8DV/Oy+CxutPGaFrgP9cchUp4=; b=ItII/P5+vrIbap0u8ezPUVAurlhS53e42g72DArFwGA2jFO1P0PywTFBx/z61mV0UG O5Q6QeOtxLMzF6h2hzNNvBqcFMlQOcooyTnrO36LKNj60hfmLUoIWmr6k0PrilIbYa1Z 4GIf+4nGdiEhJAiycwMNESdRAwe1Nby0BLRGl1zVbraWh2ub1TACxAy8qQ9UqsNPgku8 eGlXJMJACpHoy7eZPg4y5W7+WVs0snXtTq/Zq+hp9x56Q9g6b1iiVTQg+BOtS9V4Lc7V wxKExJsGiOg2Zyuls7EYJnVvc6xyd0Uw1cs67lPonMby4XI/ald9ucok8f8TCbnhl7aw 9lmQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775173425; x=1775778225; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=oEqWXZUZugakXPie80dPKHF7fN6jjN6YPQqVvO72NAI=; b=kOVWLzr3boJHFzst9FB7H7ounTj7BCA9FDAoxnG6Tiw65ra+oIGg4DiAL4mIJFPMt9 TYIGU+24MsYPZTxidD1TEzQSKZjXtUjihtaYYJR+tCQtNf380uiObodZng32Ba0L7s7M KUS7I/PVQ9sT5qpKokQmb02jAqlCHl9jFa4gtpF9P3iQ4BV9o1lwXI0WMIhGxPifpX3a TWif7R/PsaFFh/w5mCmSeFUUE3v7rAeGY8t0Rzd+2Ag0cuo76vxRU9zMoFAUP5JhsUFn Q0fZfR9ThilQ022MVC1DHEXCz6HBTXn3oAmxA0OpLFRjBh1XS8erOTESEaCWYteTW07l Ffpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775173425; x=1775778225; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=oEqWXZUZugakXPie80dPKHF7fN6jjN6YPQqVvO72NAI=; b=scgDabGXJ5GDR+HsWlBLTtOtn4Mun2m9nglV/3nsMFSHt86WZXr1wO9dPDJYQp5QX6 UEepw0Iw2D65oQfA9F1fGB2ojNq1DyBdTu0U4ivGYhvoLA/9Ad28bFs+oXAfKL4mWC18 EhB166ziMSjHDTErRJ8Pd3nnq2UusIFEUZ6FeBwreyePgy9HbR9wEIRaiVLOsMxndhPh JDTi8n23LsIR7xs7Qz20Y379F1xD54lDXvwsc+3HPcUMmX4UYAHSJxGbHn5B1/ScCcsW pXYExO1Ucpmio4RN2LsuvcOp+13LVfIuwFKw8FvIDobZCAY+Xl/vZ1189l/QInjarTb6 Vjtw== X-Forwarded-Encrypted: i=1; AJvYcCUqC4mr/d4BMUdqmlzF4mgiP8piGM2bm0PMUY9WmbF0E4GJNC0mHqgDO98KD+qBMxyUqQ2owLKg+nRtnV9Y@lists.postgresql.org X-Gm-Message-State: AOJu0Yx+/HK5RXSBfnhAq1aAEvs/UXdpwjjCMvtJd3diqMQVbIWrZ58f PjQZpPyPow19XGgrLH8TyNoZjZmaHur2Be7wWxYo8DN2SyrWeY57122a5I0y+R4f/bu1uBt0vq9 vuAKVWmnrDnuyRHG1Xs9YDa6jhc0JxUs= X-Gm-Gg: AeBDietISzET2F0LKV9TeyotNmyAtN0YZn+dwtASXqWxHvTt9v82J+cedH/xNWSgXOy BlOS3rYW63VDGWUgzTN3pK36SrihGTJgEM67Of1NBQOKWCT/0EIM7jX7gVnJ7xAF0v3OTYAyit7 3RintEgBzGkFub1GliaL4XR6k62RjVBHJmNXYGomEP8kO4lAny4k6gw0tribG8WwBRVbz+bj/oi ziiCnxBc9Jjiu0toi+qJ5KNiR2Z9UFqj/Xp28czQwgkGEaKvLPUX0o72n2nie27lWwH7dQuDA7J pXQ+oA== X-Received: by 2002:a05:6402:3553:b0:66d:d059:76cb with SMTP id 4fb4d7f45d1cf-66e3f3ce038mr438119a12.6.1775173425214; Thu, 02 Apr 2026 16:43:45 -0700 (PDT) MIME-Version: 1.0 References: <2250061.1774104346@sss.pgh.pa.us> <2555285.1774131847@sss.pgh.pa.us> <2609460.1774153487@sss.pgh.pa.us> <2790913.1774200584@sss.pgh.pa.us> <2880042.1774203473@sss.pgh!!.pa.us> <3341199.1774221191@sss.pgh.pa.us> <3424809.1774234940@sss.pgh.pa.us> <1624716.1774736283@sss.pgh.pa.us> <1626907.1774737417@sss.pgh.pa.us> <97a382c0-1f19-4ea0-951f-e37e6abc34a3@vondra.me> <1630755.1774739531@sss.pgh.pa.us> <1873141.1774823011@sss.pgh.pa.us> <3049460.1775067940@sss.pgh.pa.us> <3118179.1775092964@sss.pgh.pa.us> <3565835.1775147392@sss.pgh.pa.us> In-Reply-To: <3565835.1775147392@sss.pgh.pa.us> From: Sami Imseih Date: Thu, 2 Apr 2026 18:43:33 -0500 X-Gm-Features: AQROBzAGa5iHB-dryvf3DTlLxmWTaloJtqcq0ju33zwhFU2-t-AE9JpWdVPLJ3E Message-ID: Subject: Re: pg_waldump: support decoding of WAL inside tarfile To: Tom Lane Cc: Thomas Munro , Tomas Vondra , Andres Freund , Michael Paquier , Andrew Dunstan , Amul Sul , Zsolt Parragi , Robert Haas , Chao Li , Anthonin Bonnefoy , Fujii Masao , Jakub Wartak , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > >> So I think we need something like the attached, in addition > >> to what I sent before. This just makes astreamer_tar.c use > >> the isValidTarHeader function that pg_dump already had. > > > LGTM. > > Pushed, thanks for reviewing! In the event I decided to back-patch to > v18, where these fixes could protect pg_verifybackup against tar files > it can't handle. Hi, I just encountered a regression test failure for pg_waldump due to ebba64c0= 8d9. ```` =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95 =E2=9C=80 =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2= =80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80= =95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95=E2=80=95= =E2=80=95=E2=80=95=E2=80=95=E2=80=95 Listing only the last 100 lines from a long log. # at /local/home/simseih/pgdev/installations/worktrees/dev/src/bin/pg_wal= dump/t/001_basic.pl line 432. # got: 'pg_waldump: error: could not find WAL in archive "pg_wal.tar.gz" # ' # expected: '' ``` and regress_log_001_basic shows this: ``` # Running: /usr/bin/tar --format=3Dustar -cf /tmp/ja26rXZOnb/pg_wal.tar archive_status 000000010000000000000002 000000010000000000000001 summaries 000000010000000000000003 [22:25:00.525](0.008s) not ok 101 [22:25:00.525](0.000s) # Failed test at /local/home/simseih/pgdev/installations/worktrees/dev/src/bin/pg_waldump/t/= 001_basic.pl line 350. [22:25:00.525](0.000s) # ---------- command failed ---------- [22:25:00.526](0.000s) # /usr/bin/tar --format=3Dustar -cf /tmp/ja26rXZOnb/pg_wal.tar archive_status 000000010000000000000002 000000010000000000000001 summaries 000000010000000000000003 [22:25:00.526](0.000s) # -------------- stderr -------------- [22:25:00.526](0.000s) # /usr/bin/tar: value 10012663 out of uid_t range 0..2097151 ``` The --format=3Dustar has a limit of 2^21 (2097151) for UID/GID [1] and on my machine the UID is 10012663. So I found that one way to deal with this is to run the tar command with --owner=3D0 --group=3D0. As far as I can tell, the owner and group IDs don'= t matter for these tests, so maybe that is OK. @@ -1333,6 +1333,10 @@ sub tar_portability_options =3D=3D 0) { push(@tar_p_flags, "--format=3Dustar"); + # ustar format supports UIDs only up to 2^21 (2097151). + # Override owner/group to avoid failures on systems where + # the running user's UID/GID exceeds that limit. + push(@tar_p_flags, "--owner=3D0", "--group=3D0"); } While this fixes the test, I am now not sure what the broader implications = are for --format=3Dustar for pg_waldump in the broader discussion? [1] [https://www.gnu.org/software/tar/manual/html_section/Formats.html] -- Sami Imseih Amazon Web Services (AWS)