disabled
     ˆÈÇÌ666Æ¿Ê š    ‹      Õ˜ÑnÚ0†ïûž/vG„°•6dêH¥¡µµ™¶iš*;‰ÕG¶íž~§¦²¶R)WùO8>üŸñIŒÝ7þÕ8ø>;GŸ‚Ë4ûòñb2F¸ðµ?ðß|àXÝÀù#œh�Ÿ ¬V+kÕ·„Œ!¸†D/R”–<ÔÕ{Gîúžw„Ü„Z\‘«¹N™7É(»G"B –ZqÊX*	<Ó%e0Biˆ–Š‹yê‚V‚²’;ôaý½×+Æl¬�ù¦æZJÏÕ	úERg#¬EŽ=—/b¤d8ÂÀC‘)˜§$»³baDR=Â?&ã«ŸEèd=Ús	J$‹FøÃx4=½�aoJÌòtÎ¥É¹ J£… <âŒL¾)’}ìÝðß‡ú¦ ÏT(y®Þ]*ˆUÔP¤*'ë  Hd5Ë¤Ðçfƒ„{“1;»>ŸþäÚL	]—Ø¹{ÁOƒ½‘,ÓÈç’…ZÈ‡Ò½)õ6›«üô1D¥7ÉãDc¡z2ó@‘H)“U¤C0”iÂÓÂp)ª>ÿ2fwí~§;ìØÇ¨78éÙýGÍîuÕð-xÒ¿*‘•äE‰Gõ,Á Ó¢îðÄv÷�°E®ÂVÖÂàØ�1$DÝÞ±’¢ÔÂñþ]cDs­Ãý°ë4æ>’"+¶²§¹nSF¤aØÊ:zV÷sc�Ñ²Ÿ�h›ÿ9‹yf¶²uëWºA(UÛr‘ßî(ªQ=$v£$•gÓ^Ø6ž)&K��nE¾TIuqUÃ¶±0IT¹ÜÊV2ìvP{aÛX6‹©Úî{qÛhL�ßJ’Å¬Úõ»;õõÿAôÂ¿ºP¸°9OpÁXü¿Zí©    7   ˆl–Ãa¾”*i?u8 Y¸î41hß�þ^u¶VqÀ	æ�$®² ?Î„e§gÍÀË ?÷     #!/usr/bin/perl -wT

# Upgrade a PostgreSQL cluster to a newer major version.
#
# (C) 2005-2009 Martin Pitt <mpitt@debian.org>
# (C) 2013 Peter Eisentraut <petere@debian.org>
# (C) 2013-2022 Christoph Berg <myon@debian.org>
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.

use strict;
use warnings;
use PgCommon;
use File::Temp qw(tempfile);
use Getopt::Long;
use POSIX qw(lchown);

# untaint environment
$ENV{'PATH'} = '/bin:/usr/bin';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};

# global variables
my ($version, $newversion, $cluster, $newcluster);
my (%info, %newinfo);
my ($encoding, $old_lc_ctype, $old_lc_collate); # old cluster encoding
my $maintenance_db = 'template1';

# do not trip over cwd not being accessible to postgres superuser
chdir '/';

# update the new cluster's conffiles
sub adapt_conffiles {
    my ($newversion, $newcluster, $configfile) = @_;
    my %c = read_cluster_conf_file $newversion, $newcluster, $configfile;

    # Arguments: <ref to conf hash> <name> <comment>
    my $deprecate = sub {
        my ($conf, $guc, $comment) = @_;
        if (defined $conf->{$guc}) {
            PgCommon::disable_conf_value $newversion, $newcluster,
                $configfile, $guc, $comment;
        }
    };

    # Arguments: <ref to conf hash> <old name> <new name>
    my $rename = sub {
        my ($conf, $old, $new) = @_;
        if (defined ${$conf}{$old}) {
            PgCommon::replace_conf_value $newversion, $newcluster,
                $configfile, $old, "deprecated in favor of $new",
                $new, ${$conf}{$old};
        }
    };

    # Arguments: <config option> <value>
    my $set = sub {
        my ($guc, $val) = @_;
        PgCommon::set_conf_value $newversion, $newcluster, $configfile,
            $guc, $val;
    };

    # adapt paths to configuration files
    if ($configfile eq 'postgresql.conf') {
        $set->('data_directory', $newinfo{'pgdata'});
    } else {
        # fix bug in pg_upgradecluster 200..202
        $deprecate->(\%c, 'data_directory', 'not valid in postgresql.auto.conf');
    }
    for my $guc (qw(hba_file ident_file external_pid_file stats_temp_directory)) {
        next unless (defined $c{$guc});
        my $val = $c{$guc};
        $val =~ s/\b\Q$version\E\b/$newversion/g;
        $val =~ s/\b\Q$cluster\E\b/$newcluster/g if ($cluster ne $newcluster);
        $set->($guc, $val);
    }

    if ($newversion >= '8.2') {
        # preload_libraries -> shared_preload_libraries transition
        $rename->(\%c, 'preload_libraries', 'shared_preload_libraries');

	# australian_timezones -> timezone_abbreviations transition
	my $australian_timezones = config_bool $c{'australian_timezones'};
	if (defined $australian_timezones) {
            PgCommon::replace_conf_value $newversion, $newcluster, $configfile,
		    'australian_timezones', 'deprecated in favor of timezone_