pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #11477: psql -L no stderr
Date: Thu, 2 Oct 2014 15:56:52 -0700 (PDT)
Message-ID: <1412290612581-5821492.post@n5.nabble.com> (raw)
In-Reply-To: <20141002220315.GA20459@momjian.us>
References: <20140923144546.17171.14394@wrigleys.postgresql.org>
	<20141002220315.GA20459@momjian.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Bruce Momjian wrote
>> I am sorry, but log without errors logging is NOT a log file. I consider
>> not
>> logging stderr to logfile when -L is specified as a bug.
>> 
>> Please add coppying also stderr to logfile when -L.
> 
> The documentation says:
> 
>        -L filename
>        --log-file=filename
>            Write all query output into file filename, in addition to the
> normal output destination.
> 
> There is no mention of errors being logged here.  Logging is more than
> logging of errors.

For further emphasis:

Under \o 

"Query results" includes all tables, command responses, and notices obtained
from the database server, as well as output of various backslash commands
that query the database (such as \d), but not error messages.


Though playing with it a bit I'll agree that the functionality seems
artificially constrained.  Unfortunately, simply changing the behavior
doesn't seem like it is something that would obtain sufficient support for
the backward compatibility break.

Would something like the below work?

psql -L filename.txt -L -c "SELECT 1 = 'txt'";

The idea being you can specify a plain "-L" flag a second time and it will
redirect stderr to the same location specified in the first flag.

Being able to supervise a script but have it completely captured in the
activity log makes sense.  I guess setting ECHO to 'queries' and simply
redirecting all output to a file would be the current imposed solution but
the -L option has the nice property of cleanly setting off the "input" query
from that query's output.

I don't get why notices and warnings would be considered "query output"
while the error message resulting from a failed query would not.  I need
more than "its documented" to really convince me that this isn't an
incomplete feature - which while not a technical bug is arguably a usage
one.

I haven't thought through all possible use-cases/combination for/of terminal
& file output but taken in isolation the goal stated here makes sense and is
not currently possible - at best you get your complete file but lose the
ability to view the errors on the terminal.  Am I missing something?

David J.



--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-11477-psql-L-no-stderr-tp5820153p5821492.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (3+ messages)

Message-ID: <1412290612581-5821492.post@n5.nabble.com>
Permalink:  ../1412290612581-5821492.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1412290612581-5821492.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: david.g.johnston@gmail.com
  Subject: Re: BUG #11477: psql -L no stderr
  In-Reply-To: <1412290612581-5821492.post@n5.nabble.com>
  References: <20140923144546.17171.14394@wrigleys.postgresql.org> <20141002220315.GA20459@momjian.us> <1412290612581-5821492.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox