From 16581a897ecada7534a98f47570b3f3f4adc910f Mon Sep 17 00:00:00 2001 From: Sivakumar Krishnamurthy Date: Fri, 16 Jul 2010 18:44:46 +0530 Subject: [PATCH 1/2] First step towards making it EDB compatabile --- check_postgres.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/check_postgres.pl b/check_postgres.pl index 32bd3382..f9e55e08 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -1024,9 +1024,9 @@ sub msg_en { } -x $PSQL or ndie msg('opt-psql-noexec', $PSQL); $res = qx{$PSQL --version}; -$res =~ /^psql \(PostgreSQL\) (\d+\.\d+)(\S*)/ or ndie msg('opt-psql-nover'); -our $psql_version = $1; -our $psql_revision = $2; +$res =~ /((?:^edb\-)?psql) (\(PostgreSQL\)|EnterpriseDB) (\d+\.\d+)(\S*)/ or ndie msg('opt-psql-nover'); +our $psql_version = $3; +our $psql_revision = $4; $psql_revision =~ s/\D//g; $VERBOSE >= 2 and warn qq{psql=$PSQL version=$psql_version\n}; @@ -1940,10 +1940,10 @@ sub run_command { if ($db->{error}) { ndie $db->{error}; } - if ($db->{slurp} !~ /PostgreSQL (\d+\.\d+)/) { + if ($db->{slurp} !~ /(PostgreSQL|EnterpriseDB) (\d+\.\d+)/) { ndie msg('die-badversion', $db->{slurp}); } - $db->{version} = $1; + $db->{version} = $2; $db->{ok} = 0; delete $arg->{versiononly}; ## Remove this from the returned hash @@ -3040,7 +3040,7 @@ sub check_connection { $db = $info->{db}[0]; - my $ver = ($db->{slurp}[0]{v} =~ /PostgreSQL (\d+\.\d+\S+)/o) ? $1 : ''; + my $ver = ($db->{slurp}[0]{v} =~ /(PostgreSQL|EnterpriseDB) (\d+\.\d+\S+)/o) ? $2 : ''; $MRTG and do_mrtg({one => $ver ? 1 : 0}); From d4d771afba87c4882585ef99f6ce0b1b9d045534 Mon Sep 17 00:00:00 2001 From: "Sivakumar.K" Date: Tue, 20 Jul 2010 15:40:22 +0530 Subject: [PATCH 2/2] Fix the regex that matches psql/edb-psql --- check_postgres.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_postgres.pl b/check_postgres.pl index e84dd0e8..a6bab49a 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -1015,7 +1015,7 @@ sub msg_en { } -x $PSQL or ndie msg('opt-psql-noexec', $PSQL); $res = qx{$PSQL --version}; -$res =~ /^psql.+(\d+\.\d+)/ or ndie msg('opt-psql-nover'); +$res =~ /psql.+(\d+\.\d+)/ or ndie msg('opt-psql-nover'); our $psql_version = $1; $VERBOSE >= 2 and warn qq{psql=$PSQL version=$psql_version\n}; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy