Throw an exception when NO_PSQL_OPTION is off but --PSQL is used.
authorGreg Sabino Mullane <greg@endpoint.com>
Mon, 16 Feb 2009 14:02:58 +0000 (09:02 -0500)
committerGreg Sabino Mullane <greg@endpoint.com>
Mon, 16 Feb 2009 14:02:58 +0000 (09:02 -0500)
check_postgres.pl

index b4490684a7710e65f1958fd3360d2fef6d8fd9a7..96fef377972c435a2b913ce76818e053fde01f04 100755 (executable)
@@ -261,6 +261,7 @@ our %msg = (
        'symlink-done'       => qq{Not creating "\$1": \$2 already linked to "\$3"\n},
        'symlink-fail'       => qq{Could not symlink \$1 to \$2: \$3\n},
        'no-target-database' => q{No target databases could be found},
+       'psql-no-opt'        => q{Cannot use the --PSQL option when NO_PSQL_OPTION is on},
 },
 'de' => {
        'T-BAD-QUERY'        => q{Invalid query returned:},
@@ -399,7 +400,7 @@ sub msg {
 
 ## Everything from here on out needs psql, so find and verify a working version:
 if ($NO_PSQL_OPTION) {
-       delete $opt{PSQL};
+       delete $opt{PSQL} and ndie msg('psql-no-opt');
 }
 
 if (! defined $PSQL or ! length $PSQL) {