pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #11477: psql -L no stderr
3+ messages / 3 participants
[nested] [flat]
* BUG #11477: psql -L no stderr
@ 2014-09-23 14:45 hans@matfyz.cz
2014-10-02 22:03 ` Re: BUG #11477: psql -L no stderr Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 3+ messages in thread
From: hans@matfyz.cz @ 2014-09-23 14:45 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 11477
Logged by: Hans Ginzel
Email address: hans@matfyz.cz
PostgreSQL version: 9.4beta2
Operating system: Centos 6.5
Description:
Hello!
Command
psql -L logfile
logs only stdout (formated with stars) but not stderr.
Command
psql -L logfile 2>logfile
logs also warnings/errors but does not write them to terminal.
Command
psql 1>&2 |tee logfile
writes both to terminal and file but without stars formatting.
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.
Thank you
HG
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #11477: psql -L no stderr
2014-09-23 14:45 BUG #11477: psql -L no stderr hans@matfyz.cz
@ 2014-10-02 22:03 ` Bruce Momjian <bruce@momjian.us>
2014-10-02 22:56 ` Re: BUG #11477: psql -L no stderr David G Johnston <david.g.johnston@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Bruce Momjian @ 2014-10-02 22:03 UTC (permalink / raw)
To: hans@matfyz.cz; +Cc: pgsql-bugs
On Tue, Sep 23, 2014 at 02:45:46PM +0000, hans@matfyz.cz wrote:
> The following bug has been logged on the website:
>
> Bug reference: 11477
> Logged by: Hans Ginzel
> Email address: hans@matfyz.cz
> PostgreSQL version: 9.4beta2
> Operating system: Centos 6.5
> Description:
>
> Hello!
>
> Command
> psql -L logfile
> logs only stdout (formated with stars) but not stderr.
>
> Command
> psql -L logfile 2>logfile
> logs also warnings/errors but does not write them to terminal.
>
> Command
> psql 1>&2 |tee logfile
> writes both to terminal and file but without stars formatting.
>
> 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.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ Everyone has their own god. +
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #11477: psql -L no stderr
2014-09-23 14:45 BUG #11477: psql -L no stderr hans@matfyz.cz
2014-10-02 22:03 ` Re: BUG #11477: psql -L no stderr Bruce Momjian <bruce@momjian.us>
@ 2014-10-02 22:56 ` David G Johnston <david.g.johnston@gmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: David G Johnston @ 2014-10-02 22:56 UTC (permalink / raw)
To: pgsql-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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2014-10-02 22:56 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-09-23 14:45 BUG #11477: psql -L no stderr hans@matfyz.cz
2014-10-02 22:03 ` Bruce Momjian <bruce@momjian.us>
2014-10-02 22:56 ` David G Johnston <david.g.johnston@gmail.com>
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