CREATE SCHEMA unapi;
CREATE OR REPLACE FUNCTION evergreen.org_top()
-RETURNS SETOF actor.org_unit AS $$
+RETURNS actor.org_unit AS $$
SELECT * FROM actor.org_unit WHERE parent_ou IS NULL LIMIT 1;
-$$ LANGUAGE SQL STABLE
-ROWS 1;
+$$ LANGUAGE SQL STABLE;
CREATE OR REPLACE FUNCTION evergreen.array_remove_item_by_value(inp ANYARRAY, el ANYELEMENT)
RETURNS anyarray AS $$
--- /dev/null
+BEGIN;
+
+-- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+CREATE OR REPLACE FUNCTION evergreen.org_top()
+RETURNS actor.org_unit AS $$
+ SELECT * FROM actor.org_unit WHERE parent_ou IS NULL LIMIT 1;
+$$ LANGUAGE SQL STABLE;
+
+COMMIT:
$ENV{'PGPASSWORD'} = $settings->{pw};
$ENV{'PGPORT'} = $settings->{port};
$ENV{'PGHOST'} = $settings->{host};
- my @temp = `psql -d postgres -qtc 'show server_version;' | xargs | cut -d. -f 1,2 | tr -d '.'`;
+ my @temp = split(/ /, `psql -d postgres -qtc 'show server_version;' | xargs | cut -d. -f 1,2`);
chomp $temp[0];
my $pgversion = $temp[0];
my $cmd;
- unless ($pgversion >= '94') {
+ unless ($pgversion >= '9.4') {
my @message = ();
push(@message,
"\n------------------------------------------------------------------------------\n",
push(@output, "\nYou may need to install the postgresql plperl package on the database server.\n");
}
if(grep/No such file or directory/, @output) {
- if($pgversion >= '91') {
+ if($pgversion >= '9.1') {
push(@output, "\nYou may need to install the postgresql contrib package on the database server.\n");
} else {
push(@output, "\nYou may need to install the postgresql contrib package on this server.\n");