Re: Orphaned Files in PostgreSQL - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: Orphaned Files in PostgreSQL
Date
Msg-id arT1ZtwN2vtrnZTL@bdtpg
Whole thread
In response to Re: Orphaned Files in PostgreSQL  (Zsolt Parragi <zsolt.parragi@percona.com>)
List pgsql-hackers
Hi,

On Wed, Sep 23, 2026 at 03:10:27PM -0700, Zsolt Parragi wrote:
> Hello!
> 
> This issue is also related to a recent discussion about online
> checksums[1] and I tried to look into possible solutions into it when
> investigating that, and I agree that it should be improved.

Indeed. The proposed approach could prevent new orphan files, but it would not
address existing ones or "relation looking" files "manually" added to the data
directory. While the latter can be considered unsupported, they can trigger the
same base backup verification failure.

FWIW, pg_orphaned [1], already provides functions to list, quarantine, restore
and remove such unreferenced files. I wonder if it would be worth considering
adding pg_orphaned, or part of its functionality, to contrib, independently of
this patch?

[1]: https://github.com/bdrouvot/pg_orphaned

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Maxime Schoemans
Date:
Subject: Re: Set calcSumX2 = true in numeric_(poly_)deserialize
Next
From: Heikki Linnakangas
Date:
Subject: Re: 64-bit MultiXactOffset vs. 9.3->9.4 upgrade, pg_resetwal, "wraparound" msg