Re: BUG #3269: PSQL does not display error output - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #3269: PSQL does not display error output
Date
Msg-id 26456.1179003159@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #3269: PSQL does not display error output  (Bojan Jovanovic <bjovanovic@bjovanovic.com>)
List pgsql-bugs
Bojan Jovanovic <bjovanovic@bjovanovic.com> writes:
> Here is the full strace of: echo "select * from sadfasdfas;" | strace psql -U ***** *****
> (no sadfasfaf table..)

Well, it's sending the query as expected:

> read(0, "select * from sadfasdfas;\n", 4096) = 26
> rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_DFL}, 8) = 0
> send(3, "Q\0\0\0\36select * from sadfasdfas;\0", 31, 0) = 31
> rt_sigaction(SIGPIPE, {SIG_DFL}, {SIG_IGN}, 8) = 0

and getting the error response as expected:

> poll([{fd=3, events=POLLIN|POLLERR, revents=POLLIN}], 1, -1) = 1
> recv(3, "E\0\0\0]SERROR\0C42P01\0Mrelation \"sa"..., 16384, 0) = 100

and making absolutely no effort to write anything on stderr:

> rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
> read(0, "", 4096)                       = 0
> rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_DFL}, 8) = 0
> send(3, "X\0\0\0\4", 5, 0)              = 5
> rt_sigaction(SIGPIPE, {SIG_DFL}, {SIG_IGN}, 8) = 0
> close(3)                                = 0
> rt_sigaction(SIGPIPE, {SIG_DFL}, {SIG_DFL}, 8) = 0
> exit_group(0)                           = ?

That's just bizarre.  I don't see any way that psql wouldn't try to
print the error, unless libpq is giving it bad information about the
PGresult's status (or maybe an empty error message?).  I think maybe
there is something busted about your libpq, though it's hard to think of
something that would only affect error reporting.  Did you build with
debug enabled, such that you could step through AcceptResult() in psql
and see what's happening?

            regards, tom lane

pgsql-bugs by date:

Previous
From: Bojan Jovanovic
Date:
Subject: Re: BUG #3269: PSQL does not display error output
Next
From: "Alan Mercer"
Date:
Subject: BUG #3274: Failed to run initdb