postgres.git / summary / log / commit / refs
commit b27d566f033ab0592ea1bf4b3c397b25ba8f2a7c
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Tue Oct 20 22:49:30 2026 +0000
First released in: 14.25, 15.20, 16.16, 17.12, 18.7, 19.0
Fix cross-version upgrade tests for commits 0497318e4 et al.
Dumps taken from unpatched versions (pre-v14) will not have the AS
keyword that ruleutils.c now prints, causing a harmless diff in dump
output. Adjust the cross-version upgrade's old dump to make it match.
While I'm here, move the stanza that I hastily put in a non-optimal
place in commit f8ab6c622. It's worth fixing because it messed up
the logical structure of adjust_database_contents, making it
un-obvious where to put future additions.
Per buildfarm.
src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm | 46 +++++++++++++++-----------
1 file changed, 27 insertions(+), 19 deletions(-)
diff --git a/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm b/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm
index 3ba962f47c5..4669168ec5f 100644
--- a/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm
+++ b/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm
@@ -106,25 +106,6 @@ sub adjust_database_contents
'drop extension if exists test_ext7');
}
- # We can no longer upgrade bpchar indexes that claim deduplication ability
- # (amcheck will complain about them), so drop them if source is pre-v14.
- if ($old_version < 14)
- {
- if ($dbnames{"regression"})
- {
- _add_st($result, 'regression',
- 'drop index if exists public.hslot_hubname',
- 'drop index if exists public.hslot_name',
- 'drop index if exists public.hub_name',
- 'drop index if exists public.iface_name',
- 'drop index if exists public.phone_name',
- 'drop index if exists public.pline_name',
- 'drop index if exists public.pslot_name',
- 'drop index if exists public.room_rno',
- 'drop index if exists public.wslot_name');
- }
- }
-
# stuff not supported from release 16
if ($old_version >= 12 && $old_version < 16)
{
@@ -171,6 +152,22 @@ sub adjust_database_contents
_add_st($result, 'contrib_regression_seg',
"delete from test_seg where s = '4.6 .. ~7.0'");
}
+
+ # We can no longer upgrade bpchar indexes that claim deduplication
+ # ability (amcheck will complain about them)
+ if ($dbnames{'regression'})
+ {
+ _add_st($result, 'regression',
+ 'drop index if exists public.hslot_hubname',
+ 'drop index if exists public.hslot_name',
+ 'drop index if exists public.hub_name',
+ 'drop index if exists public.iface_name',
+ 'drop index if exists public.phone_name',
+ 'drop index if exists public.pline_name',
+ 'drop index if exists public.pslot_name',
+ 'drop index if exists public.room_rno',
+ 'drop index if exists public.wslot_name');
+ }
}
# user table OIDs are gone from release 12 on
@@ -325,6 +322,17 @@ sub adjust_old_dumpfile
{$1;}mxg;
}
+ if ($old_version < 14)
+ {
+ # Fix up some rule definitions that ruleutils now prints with AS.
+ $dump =~ s {DO INSTEAD UPDATE public\.rules_log trgt SET tag}
+ {DO INSTEAD UPDATE public.rules_log AS trgt SET tag};
+ $dump =~ s {UPDATE public\.int4_tbl trgt_1 SET}
+ {UPDATE public.int4_tbl AS trgt_1 SET};
+ $dump =~ s {DELETE FROM public\.int4_tbl trgt_1}
+ {DELETE FROM public.int4_tbl AS trgt_1};
+ }
+
# Change trigger definitions to say ... EXECUTE FUNCTION ...
if ($old_version < 12)
{
[parent: 715bf0305748]