Re: psql output locations

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql output locations
Date: 2012-08-17 15:17:58
Message-ID: 20120817151758.GA3371@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 14, 2011 at 10:57:25AM -0500, Robert Haas wrote:
> On Wed, Dec 14, 2011 at 4:45 AM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> >>> * There are a number of things that are always written to stdout, that
> >>> there is no way to redirect. In some cases it's interactive prompts -
> >>> makes sense - but also for example the output of \timing goes to
> >>> stdout always. Is there some specific logic behind what/when this
> >>> should be done?
> >>
> >> Everything that is not an error goes to stdout, no?  Except the query
> >> output, if you change it.
> >>
> >> Maybe the way to do what you want is to invent a new setting that
> >> temporarily changes stdout.
> >
> > Yeah, that might be it. Or I need separate settings for "put errors in
> > the query output stream" and "put non-query-output-but-also-non-errors
> > in the query output stream". The effect would be the same, I guess...
>
> That seems an awful lot harder (and messier) than just changing the
> all the call sites to use the same error-reporting function.

I have done as you suggested with the attached patch.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

Attachment Content-Type Size
psql.diff text/x-diff 16.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2012-08-17 15:36:04 Re: Planner avoidance of index only scans for partial indexes
Previous Message Alvaro Herrera 2012-08-17 14:53:21 SERIAL columns in foreign tables