Thread: How to check for pg_dump errors?

How to check for pg_dump errors?

From
Chris Hoover
Date:
Silly question, but in a shell script, what is the best way to check for a pg_dump problem?  I'm working on reworking our backup methodology, and want to make sure that if pg_dump can't dump a db, we page the on call db.  Does it return any sort of exit code indicating it was not successful dumping a database?

Thanks,

Chris

Re: How to check for pg_dump errors?

From
Tom Lane
Date:
Chris Hoover <revoohc@gmail.com> writes:
> Silly question, but in a shell script, what is the best way to check for a
> pg_dump problem? I'm working on reworking our backup methodology, and want
> to make sure that if pg_dump can't dump a db, we page the on call db. Does
> it return any sort of exit code indicating it was not successful dumping a
> database?

pg_dump should return nonzero exit code on failure.  (At least in recent
releases ... not sure about how far back that's been done consistently.)

            regards, tom lane

Re: How to check for pg_dump errors?

From
Peter Eisentraut
Date:
Am Freitag, 7. Oktober 2005 22:13 schrieb Chris Hoover:
> Silly question, but in a shell script, what is the best way to check for a
> pg_dump problem?

0 is success, nonzero is failure.