When checking postgresql version use postgres db
authorThomas Berezansky <tsbere@mvlc.org>
Fri, 9 Sep 2011 14:25:10 +0000 (10:25 -0400)
committerDan Scott <dscott@laurentian.ca>
Sat, 10 Sep 2011 16:43:43 +0000 (12:43 -0400)
Otherwise we may get an error instead of a version number.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/support-scripts/eg_db_config.pl

index ef49e98..93c53fa 100755 (executable)
@@ -136,7 +136,7 @@ sub create_database {
        $ENV{'PGPASSWORD'} = $settings->{pw};
        $ENV{'PGPORT'} = $settings->{port};
        $ENV{'PGHOST'} = $settings->{host};
        $ENV{'PGPASSWORD'} = $settings->{pw};
        $ENV{'PGPORT'} = $settings->{port};
        $ENV{'PGHOST'} = $settings->{host};
-       my @temp = `psql -qtc 'show server_version;' | xargs | cut -c1,3`;
+       my @temp = `psql -d postgres -qtc 'show server_version;' | xargs | cut -c1,3`;
        chomp $temp[0];
        my $pgversion = $temp[0];
        my $cmd;
        chomp $temp[0];
        my $pgversion = $temp[0];
        my $cmd;