Re: Do we want to avoid checksumming extra files in the datadir? [was: BUG #19647]

From: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Edwin Polkerman <edwin(dot)polkerman(at)splendiddata(dot)com>
Subject: Re: Do we want to avoid checksumming extra files in the datadir? [was: BUG #19647]
Date: 2026-09-15 18:51:22
Message-ID: CAOYmi+mMy4RFVcicTiHj6Yqkj=0_E6uAHR56NwgZXWc9tcDT7A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Thu, Sep 3, 2026 at 11:30 AM Jacob Champion
<jacob(dot)champion(at)enterprisedb(dot)com> wrote:
> Sounds good, thanks both! Attached is the simplest thing that could
> fix the reported problem (and nothing else), but I'd rather look into
> moving parse_filename_for_nontemp_relation() to common/relfile.c so it
> can be used directly. I probably won't have time for that today.

Here's a v2 to do that, which I like much better.

The --filenode argument now filters via integer equality rather than a
string comparison. I think there are two main side effects (let me
know if either is unacceptable):
1) we now prohibit `pg_checksums --filenode 0`, which IIUC isn't ever
helpful in practice, and
2) leading zeroes in the --filenode arg are now ignored, rather than
causing pg_checksums to match nothing. I.e. `--filenode 001260` will
now match relfile 1260.

Are there are any corner cases I've missed where you want pg_checksums
to check a temporary relation's relfiles? Even if a clean shutdown and
startup somehow left them around, they still wouldn't be used, right?

Thanks,
--Jacob

Attachment Content-Type Size
v2-0001-Move-relfile-name-parsing-to-src-common.patch application/octet-stream 6.9 KB
v2-0002-pg_checksums-Disallow-filenode-0.patch application/octet-stream 1.6 KB
v2-0003-WIP-pg_checksums-Ignore-stray-files-in-directorie.patch application/octet-stream 6.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ilia Evdokimov 2026-09-15 18:58:22 Re: Apply extended statistics to join clause during parameterized path costing
Previous Message surya poondla 2026-09-15 18:48:49 Re: pg_xmin_horizon: a system view of everything pinning the xmin horizon

Browse pgsql-bugs by date

  From Date Subject
Previous Message Robert Treat 2026-09-15 18:30:34 Re: REPACK (CONCURRENTLY) doesn't handle invalid indexes