Skip to content

Commit

Permalink
Block Babelfish restore on versions prior to 15.5 (#2088)
Browse files Browse the repository at this point in the history
Restore can only be performed on PG15.5 or higher versions, this commits blocks it on older versions.

Signed-off-by: Rishabh Tanwar [email protected]
  • Loading branch information
rishabhtanwar29 authored Dec 1, 2023
1 parent 829a394 commit 2761453
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions contrib/babelfishpg_tds/test/t/004_bbfdumprestore.pl
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,34 @@
'Restore of Babelfish database failed since source and target versions do not match.');
$newnode->stop;

# Restore is not supported on versions older than 15.5.
$oldnode->start;

$oldnode->command_fails_like(
[
'psql',
'-d', 'testdb',
'-U', 'test_master',
'-p', $oldnode->port,
'--single-transaction',
'-f', $dump1_file,
],
qr/Target Postgres version must be 15.5 or higher for Babelfish restore./,
'Restore of global objects failed since target version is older than 15.5.');

$oldnode->command_fails_like(
[
'psql',
'-d', 'testdb',
'-U', 'test_master',
'-p', $oldnode->port,
'--single-transaction',
'-f', $dump2_file,
],
qr/Target Postgres version must be 15.5 or higher for Babelfish restore./,
'Restore of Babelfish database failed since target version is older than 15.5.');
$oldnode->stop;

############################################################################################
############################## Test for cross migration mode ###############################
############################################################################################
Expand Down

0 comments on commit 2761453

Please sign in to comment.