User control over psql error stream

From: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: User control over psql error stream
Date: 2012-11-15 20:53:24
Message-ID: 1353012804.27898.1@mofo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

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.

Control is provided via a new "estream" \pset. Here's
the docs.

-------------------------<snip>------------------------
estream

Controls the output stream(s) used to report error messages. Value
must be one of: stderr (the default), which sends errors to the
standard error stream; query, which injects error messages into the
query result output stream; or both, which sends errors to both output
streams. "Error messages" are comprised of errors from psql and notice
messages and errors from the database server.
-------------------------<snip>------------------------

Against head.

psql-estream.patch The patch.
psql-estream_test.patch Adds a regression test to test the patch.

There's a number of problems with psql-estream_test.patch,
the most notable is that it probably won't work on
MS Windows because it uses /dev/null to avoid touching the
host filesystem. I'm not sure whether this should have
a regression test and if so what the right way is to do it.

Note that psql-stream.patch includes some re-writing of
the docs for the psql \o option that goes slightly beyond
the minimum change required to explain \pset estream's effects.

Regards,

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

Attachment Content-Type Size
psql-estream.patch text/x-patch 6.8 KB
psql-estream_test.patch text/x-patch 3.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2012-11-15 20:57:43 Re: Further pg_upgrade analysis for many tables
Previous Message Jeff Janes 2012-11-15 20:41:24 Re: pg_ctl reload -o "...."