This is getting stranger. If I login as 'root' and run the following command :

        /bin/su postgres -c "/usr/local/pgsql/bin/pg_dump -Ft > /tmp/dbase.backup.tar ; echo $? > /tmp/errfile"

then errfile contains a return code of 0 (zero).

If I login as 'postgres' and run the following command :

            /usr/local/pgsql/bin/pg_dump -Ft > /tmp/dbase.backup.tar ; echo $? > /tmp/errfile

then errfile contains a return code of 1 (one)!

In both cases, the error message is :

        pg_dump: [tar archiver] could not write to tar member (wrote 158, attempted 285)

I have since found that this is not caused by a space problem since the last time I ran the command, only 90% of the disk was used when it crashed. Does this mean there is corruption in the dbase? Or is it perhaps that a temporary dump file is getting too big? (Where are these temp files created?)

Thanks in advance for the help.

Regards,
   Derek Main.


Tom Lane wrote:
Derek Main <[EMAIL PROTECTED]> writes:
I run a pg-dump in one of my scripts and want to send an e-mail on 
failure (i.e. non-zero return code). This particular dump ran out of
disk space and failed. However, the return code is zero!

That seems like a bug. Looking at current sources, it seems that
pg_dump will always exit(1) if it detects a failure --- did it not
notice the failure?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend




Reply via email to