From 1d3ca3f90db4d669b80286535352be4549c54b5f Mon Sep 17 00:00:00 2001 From: Ayush Tiwari Date: Fri, 5 Jun 2026 19:10:35 +0000 Subject: [PATCH v1 2/2] Handle refint removal in cross-version pg_upgrade tests. The previous commit removes the refint extension in v20. When cross- version pg_upgrade tests upgrade from a version that still shipped refint, the upgraded contrib_regression_spi (and regression_spi) databases still have the refint extension and its tables (pkeys, fkeys, fkeys2) in their catalogs, but a fresh v20 install does not. Without adjustment the dump comparison fails. Teach AdjustUpgrade.pm to drop the refint extension and its leftover tables in those databases when the source version is < 20, matching the existing pattern for prior cross-version test fixtures. Discussion: https://postgr.es/m/CAJTYsWXU%2BfhuzrEd_bnrxyGH3%2Bny8QRQC2QHf3ws6s9iki3c2Q%40mail.gmail.com --- .../perl/PostgreSQL/Test/AdjustUpgrade.pm | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm b/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm index 8a0c6c98a39..18b52d26f3e 100644 --- a/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm +++ b/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm @@ -141,6 +141,27 @@ sub adjust_database_contents } } + # refint was removed in v20 + if ($old_version < 20) + { + if ($dbnames{"contrib_regression_spi"}) + { + _add_st( + $result, + 'contrib_regression_spi', + 'drop extension if exists refint cascade', + 'drop table if exists pkeys, fkeys, fkeys2'); + } + if ($dbnames{"regression_spi"}) + { + _add_st( + $result, + 'regression_spi', + 'drop extension if exists refint cascade', + 'drop table if exists pkeys, fkeys, fkeys2'); + } + } + # we removed these test-support functions in v18 if ($old_version < 18) { -- 2.43.0