From: glyn Date: Tue, 4 Oct 2016 15:17:44 +0000 (+0100) Subject: Only try and map an obsoleted guc setting to a new one if the obsoleted setting was... X-Git-Url: https://git.8kb.co.uk/?p=postgresql%2Fpg_upgrade_conf;a=commitdiff_plain;h=d62e80a9e4e96e08b1d0859eef6992627e3d4e60 Only try and map an obsoleted guc setting to a new one if the obsoleted setting was actually set in the old config. --- diff --git a/pg_upgrade_conf.pl b/pg_upgrade_conf.pl index b526aec..68e8774 100755 --- a/pg_upgrade_conf.pl +++ b/pg_upgrade_conf.pl @@ -201,7 +201,7 @@ sub modifyNewFile { if ($g_debug) { print "DEBUG: Target file key = $key value = $value\n"; } - if (!exists($g_gucs{$key}) && exists($g_gucs_map{$key})) { + if (!exists($g_gucs{$key}) && exists($g_gucs_map{$key}) && exists($g_gucs{$g_gucs_map{$key}[0]})) { $g_gucs{$key} = eval($g_gucs{$g_gucs_map{$key}[0]} . $g_gucs_map{$key}[1]) . (defined($g_gucs_map{$key}[2])?"$g_gucs_map{$key}[2]":""); $g_gucs_src{$key} .= "(mapped from $g_gucs_map{$key}[0] = $g_gucs{$g_gucs_map{$key}[0]})"; push(@lines, "# $g_gucs_map{$key}[0] = $g_gucs{$g_gucs_map{$key}[0]} # Obsoleted by $key as of pg $g_gucs_obs{$g_gucs_map{$key}[0]}[0] by $key = $g_gucs_map{$key}[0]$g_gucs_map{$key}[1] $g_gucs_map{$key}[2]");