pg_combinebackup: Fix PITR comparison test in 002_compare_backups
authorMichael Paquier <michael@paquier.xyz>
Tue, 17 Dec 2024 00:23:49 +0000 (09:23 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 17 Dec 2024 00:23:49 +0000 (09:23 +0900)
commite116b703f0b9b551cb413c8f2cfe231a9ce73f42
treeab8501482165cd9e2a6524753d937e94aeb74411
parent0cc7da4e234c3027cc1f96ffcb1365bf96301587
pg_combinebackup: Fix PITR comparison test in 002_compare_backups

The test was creating both the dumps to compare from the same database
on the same node, so it would never detect any mismatches when comparing
the logical dumps of the two servers.

Fixing this issue has revealed that there is a difference in the dumps:
the tablespaces paths are different.  This commit uses compare_text()
with a custom comparison function to erase the difference (slightly
tweaked to be able to work with WIN32 and non-WIN32 paths).  This way,
the non-relevant parts of the tablespace path are ignored from the check
with the basic structure of the query string still compared.

Author: Dagfinn Ilmari Mannsåker
Discussion: https://postgr.es/m/87h67653ns.fsf@wibble.ilmari.org
Backpatch-through: 17
src/bin/pg_combinebackup/t/002_compare_backups.pl