On 9/10/26 22:37, Tom Lane wrote:
Robert Haas <[email protected]> writes:
But much more seriously, Claude also noticed this: In general, if
PostgreSQL creates a relation and then crashes before commit, the
relation files are left on disk and not removed, but there's no
catalog entry pointing to them any more. If checksums are enabled
using pg_checksums, such files are updated to have checksums as well.
But this feature enables checksums by working through the catalog, so
it won't update those files. That means that if, at any point in the
history of the cluster, there's ever been a crash that left a relation
file behind on disk, and then you use this feature to enable
checksums, and then after that you take a base backup, checksum
verification will fail, and thus the backup will fail. I don't quite
see how we can actually fix this, and it seems like a serious problem.
Don't we have logic somewhere to clean up orphaned relation files?
regards, tom lane
There is an item [1] on the TODO list, and a thread [2]:
[1] https://wiki.postgresql.org/wiki/Todo#Administration
[2]
https://www.postgresql.org/message-id/flat/200606081508.k58F85m29270%40candle.pha.pa.us