Skip site navigation (1) Skip section navigation (2)

Re: pg_dump output goes to stderr, not stdout?!?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Damian C" <jamianb(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: pg_dump output goes to stderr, not stdout?!?
Date: 2006-08-21 01:23:36
Message-ID: 19481.1156123416@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
"Damian C" <jamianb(at)gmail(dot)com> writes:
> QuestionOne: Should this output go to sdout, and NOT to stderr???

No, because what normally goes to stdout is the dump data proper.
Commentary has to be sent to stderr to keep it separate.

As a general rule I don't think programs should have to read other
programs' stderr output at all --- certainly not for "did it work or
not" questions.  What you ought to be doing is looking at pg_dump's
process exit code to find out whether it had a problem or not.

As for whether it's worth logging the stderr output for human
inspection: probably, but don't use -v.  -v is *intended* to
create a lot of normally-useless chatter.

			regards, tom lane

In response to

Responses

pgsql-novice by date

Next:From: Damian CDate: 2006-08-21 01:34:07
Subject: Re: pg_dump output goes to stderr, not stdout?!?
Previous:From: Damian CDate: 2006-08-21 01:15:10
Subject: pg_dump output goes to stderr, not stdout?!?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group