Thread: pg_dump warning format?

pg_dump warning format?

From
Erik Jones
Date:
Hello, I'm currently working on an automated data archival script that will dump an existing archive db, drop it, recreate it from a template, and then fill it with any data ready to be archived from our production db.  My question here is:  What is the format of the warnings and/or errors that pg_dump will spit out on standard error?  Does redirect_stderr set in the config file affect the pg_dump utility?  Basically I need a way for my script to know if it needs to abort because there were issues with the dump before it follows through with the drop db...

erik jones <erik@myemma.com>
sofware developer
615-296-0838
emma(r)



Re: pg_dump warning format?

From
Tom Lane
Date:
Erik Jones <erik@myemma.com> writes:
> Basically I need a way for my script to know if it needs to
> abort because there were issues with the dump before it follows
> through with the drop db...

Well, just checking the exit status from pg_dump ought to give you at
least a go/no-go indicator.  If you want to be significantly more
paranoid, you could try the theory that *any* output to stderr is
indicative of a problem.

            regards, tom lane

Re: pg_dump warning format?

From
Erik Jones
Date:
On Mar 15, 2007, at 9:08 PM, Tom Lane wrote:

Erik Jones <erik@myemma.com> writes:
Basically I need a way for my script to know if it needs to  
abort because there were issues with the dump before it follows  
through with the drop db...

Well, just checking the exit status from pg_dump ought to give you at
least a go/no-go indicator.  If you want to be significantly more
paranoid, you could try the theory that *any* output to stderr is
indicative of a problem.

Thanks.  I guess I just wasn't sure as to whether or not anything other than "bad" messages were written to stderr.  Given the intent of stderr you wouldn't think so, but I've seen cases where it was so.

erik jones <erik@myemma.com>
sofware developer
615-296-0838
emma(r)