Trial fix for old cross-version upgrades.
authorJeff Davis <[email protected]>
Thu, 20 Feb 2025 18:21:24 +0000 (10:21 -0800)
committerJeff Davis <[email protected]>
Thu, 20 Feb 2025 18:21:24 +0000 (10:21 -0800)
Per buildfarm and reports, it seems that 9.X to 18 upgrades were
failing after commit 1fd1bd8710 due to an incorrect regex. Loosen the
regex to accommodate older versions.

Reported-by: vignesh C <[email protected]>
Reported-by: Andrew Dunstan <[email protected]>
Discussion: https://postgr.es/m/CALDaNm3GUs+U8Nt4S=V5zmb+K8-RfAc03vRENS0teeoq0Lc6Tw@mail.gmail.com
Discussion: https://postgr.es/m/ea4cbbc1-c5a5-43d1-9618-8ff3f2155bfe@dunslane.net

src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm

index 264c33b45d078ced907decf7f4bcb36413a7efe4..c6455427df546039e17bee27b0bcbe3ee47ce4ff 100644 (file)
@@ -296,7 +296,7 @@ sub adjust_old_dumpfile
 
    # Same with version argument to pg_restore_relation_stats() or
    # pg_restore_attribute_stats().
-   $dump =~ s ['version', '${old_version}\d{4}'::integer,]
+   $dump =~ s ['version', '\d+'::integer,]
        ['version', '000000'::integer,]mg;
 
    if ($old_version < 16)
@@ -633,7 +633,7 @@ sub adjust_new_dumpfile
 
    # Same with version argument to pg_restore_relation_stats() or
    # pg_restore_attribute_stats().
-   $dump =~ s ['version', '\d{6}'::integer,]
+   $dump =~ s ['version', '\d+'::integer,]
        ['version', '000000'::integer,]mg;
 
    if ($old_version < 14)