Skip to content

Commit 3adcf9f

Browse files
author
Álvaro Herrera
committed
Adapt pg_upgrade test to pg_lsn output format difference
Commit 2633dae added some zero padding to various LSNs output routines so that the low word is always 8 hex digits long, for easy human consumption. This included the pg_lsn datatype, which breaks the pg_upgrade test when it compares the pg_dump output of an older version. Silence this problem by setting the pg_lsn columns to NULL before the upgrade. Discussion: https://postgr.es/m/202507071504.xm2r26u7lmzr@alvherre.pgsql
1 parent 87b05fd commit 3adcf9f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,32 @@ sub adjust_database_contents
251251
'drop operator if exists public.=> (bigint, NONE)');
252252
}
253253

254+
# Version 19 changed the output format of pg_lsn. To avoid output
255+
# differences, set all pg_lsn columns to NULL if the old version is
256+
# older than 19.
257+
if ($old_version < 19)
258+
{
259+
if ($old_version >= '9.5')
260+
{
261+
_add_st($result, 'regression',
262+
"update brintest set lsncol = NULL");
263+
}
264+
265+
if ($old_version >= 12)
266+
{
267+
_add_st($result, 'regression',
268+
"update tab_core_types set pg_lsn = NULL");
269+
}
270+
271+
if ($old_version >= 14)
272+
{
273+
_add_st($result, 'regression',
274+
"update brintest_multi set lsncol = NULL");
275+
_add_st($result, 'regression',
276+
"update brintest_bloom set lsncol = NULL");
277+
}
278+
}
279+
254280
return $result;
255281
}
256282

0 commit comments

Comments
 (0)