Exit right away on FATAL errors.
authorGreg Sabino Mullane <[email protected]>
Tue, 7 Oct 2008 15:56:12 +0000 (11:56 -0400)
committerGreg Sabino Mullane <[email protected]>
Tue, 7 Oct 2008 15:56:12 +0000 (11:56 -0400)
Prevents excess looping due to verify_version check, and
gives a better error for actions that were using 'failok'

check_postgres.pl

index 25b9a1808238089fccaa0a10ccfe4b2f58d703dd..85282cb3aaba55cb548a71b9a0f125db2c686e55 100755 (executable)
@@ -965,6 +965,11 @@ sub run_command {
                                $db->{error} =~ s/^psql: //;
                                $ERROR = $db->{error};
                        }
+
+                       if ($db->{error} =~ /FATAL/) {
+                               ndie "$db->{error}";
+                       }
+
                        if (!$db->{ok} and !$arg->{failok}) {
 
                                ## Check if problem is due to backend being too old for this check