Re: User control over psql error stream

From: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
To: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: User control over psql error stream
Date: 2012-12-07 20:50:48
Message-ID: 1354913448.6378.0@mofo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/21/2012 11:33:18 PM, Karl O. Pinc wrote:
> On 11/21/2012 01:41:56 PM, Peter Eisentraut wrote:
> > On 11/15/12 3:53 PM, Karl O. Pinc wrote:
> > > This patch gives the end user control over psql's
> > > error stream. This allows a single psql session
> > > to use \o to send both errors and table output
> > > to multiple files. Useful when capturing test output, etc.
> >
> > What does this do that cannot in practice be achieved using shell
> > redirection operators?
>
> To look at it from another angle, you need it for the
> same reason you need \o -- to redirect output
> to multiple places from within a single psql process.
> \o redirects stdout, but I'm interested in
> redirecting stderr.

There is an interaction here with \set EXIT_ON_ERROR
that may need additional documentation. As the patch is,
when \set EXIT_ON_ERROR is used the error stream is sent
to stderr in addition to the \pset estream setting.
At least I think this is what is happening.
This behavior seems correct to me.

Before proceeding further I would like to wait
for feedback regarding whether a \e command,
per above and previous, is preferable to the existing patch's
\pset estream.

Regards,

Karl <kop(at)meme(dot)com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-12-07 21:21:48 Re: pg_upgrade problem with invalid indexes
Previous Message Bruce Momjian 2012-12-07 19:24:49 Re: pg_upgrade problem with invalid indexes