Justus Janssen wrote:
Quote:
we've been using a batch file containing a call to reindexdb.exe , vacuumdb.exe and pg_dump.exe on a regular basis, and recently
found that sometimes one or more of these commands fail. To check that, I've added
IF %ERRORLEVEL%==0 GOTO (next step) ...
GOTO PGERROR
lines in the batch file, which seem to work perfectly for reindexdb.exe and vacuumdb.exe . pg_dump however, does not set the
ERRORLEVEL variable. Is there a way to detect pg_dump has encountered a problem? Right now, I'm testing by stopping the PostgreSQL
service.
Also, is there a list of possible error values available for these commands? |
Which version are you using?
I tried with an 8.2 Windows client installation, and ERRORLEVEL was set
appropriately.
For all tests I ran, the only error level returned was "1", no matter
if it was a connection problem or a problem with the database.
So your test as quoted above should work fine.
What do you get if you run:
pg_dump -h notexists nondatabase
echo %ERRORLEVEL%
in your MS-DOS box?
Yours,
Laurenz Albe