Re: [GENERAL] pg_dump return status.. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] pg_dump return status..
Date
Msg-id 26583.978659409@sss.pgh.pa.us
Whole thread Raw
In response to RE: [GENERAL] pg_dump return status..  (Matthew <matt@ctlno.com>)
Responses Re: Re: [GENERAL] pg_dump return status..  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
Matthew <matt@ctlno.com> writes:
> I posted a note to the hackers list about this very issue last week.  It was
> never responded to.  I am prepared to do the work and submit a patch, but I
> wanted some input on how best to do it.  We had a problem with a backup
> script silently failing when the disk was full.

Talk to Philip Warner about detecting output write failures.  I think
this might be a lot easier in current sources than it would have been in
7.0.* or before; the actual I/O is more centralized, and I think you
could reasonably hope to check for write errors at just a couple of
places.  But I'm not sure where the best places are.

>> I find that irrespective of the fact whether pg_dump managed to connect
>> to the db or not the return status ($?) is always zero.

I think this is probably some sort of mistake in your script.  pg_dump
certainly returns a nonzero exit status for any failure that it detects,
at least in all the versions I've used.  Matthew's correct that it
doesn't detect write failure on its output file, but that's not the
case you're claiming...

            regards, tom lane

pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Re: RE: [GENERAL] pg_dump return status..
Next
From: "Luis Fernando Fabara M."
Date:
Subject: Cobol TO SQL To PostgreSQL