mirror of
https://github.com/postgres/postgres.git
synced 2025-06-04 00:02:37 -04:00
Ignore hash's relallvisible when checking pg_upgrade from pre-v10.
Our cross-version upgrade tests have been failing for some pre-v10 source versions since commit 1fd1bd871. This turns out to be because relallvisible may change for tables that have hash indexes, because the upgrade process forcibly reindexes such indexes to deal with the changes made in v10. Fortunately, the set of tables that have such indexes is small and won't change anymore in those branches. So just hack up AdjustUpgrade.pm to not compare the relallvisible values of those specific tables. While here, also tighten the regex that suppresses comparison of version fields. Discussion: https://postgr.es/m/812817.1740277228@sss.pgh.pa.us
This commit is contained in:
parent
454c182f85
commit
fc0d0ce978
@ -296,8 +296,8 @@ sub adjust_old_dumpfile
|
||||
|
||||
# Same with version argument to pg_restore_relation_stats() or
|
||||
# pg_restore_attribute_stats().
|
||||
$dump =~ s ['version', '\d+'::integer,]
|
||||
['version', '000000'::integer,]mg;
|
||||
$dump =~ s {(^\s+'version',) '\d+'::integer,$}
|
||||
{$1 '000000'::integer,}mg;
|
||||
|
||||
if ($old_version < 16)
|
||||
{
|
||||
@ -338,6 +338,18 @@ sub adjust_old_dumpfile
|
||||
/$1 EXECUTE FUNCTION/mgx;
|
||||
}
|
||||
|
||||
# During pg_upgrade, we reindex hash indexes if the source is pre-v10.
|
||||
# This may change their tables' relallvisible values, so don't compare
|
||||
# those.
|
||||
if ($old_version < 10)
|
||||
{
|
||||
$dump =~ s/
|
||||
(^SELECT\s\*\sFROM\spg_catalog\.pg_restore_relation_stats\(
|
||||
\s+'relation',\s'public\.hash_[a-z0-9]*_heap'::regclass,
|
||||
[^;]*'relallvisible',)\s'\d+'::integer
|
||||
/$1 ''::integer/mgx;
|
||||
}
|
||||
|
||||
if ($old_version lt '9.6')
|
||||
{
|
||||
# adjust some places where we don't print so many parens anymore
|
||||
@ -633,8 +645,8 @@ sub adjust_new_dumpfile
|
||||
|
||||
# Same with version argument to pg_restore_relation_stats() or
|
||||
# pg_restore_attribute_stats().
|
||||
$dump =~ s ['version', '\d+'::integer,]
|
||||
['version', '000000'::integer,]mg;
|
||||
$dump =~ s {(^\s+'version',) '\d+'::integer,$}
|
||||
{$1 '000000'::integer,}mg;
|
||||
|
||||
# pre-v16 dumps do not know about XMLSERIALIZE(NO INDENT).
|
||||
if ($old_version < 16)
|
||||
@ -673,6 +685,18 @@ sub adjust_new_dumpfile
|
||||
$dump =~ s/^SET default_table_access_method = heap;\n//mg;
|
||||
}
|
||||
|
||||
# During pg_upgrade, we reindex hash indexes if the source is pre-v10.
|
||||
# This may change their tables' relallvisible values, so don't compare
|
||||
# those.
|
||||
if ($old_version < 10)
|
||||
{
|
||||
$dump =~ s/
|
||||
(^SELECT\s\*\sFROM\spg_catalog\.pg_restore_relation_stats\(
|
||||
\s+'relation',\s'public\.hash_[a-z0-9]*_heap'::regclass,
|
||||
[^;]*'relallvisible',)\s'\d+'::integer
|
||||
/$1 ''::integer/mgx;
|
||||
}
|
||||
|
||||
# dumps from pre-9.6 dblink may include redundant ACL settings
|
||||
if ($old_version lt '9.6')
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user