Re: BUG #3269: PSQL does not display error output

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bojan Jovanovic <bjovanovic(at)bjovanovic(dot)com>
Cc: Michael Fuhr <mike(at)fuhr(dot)org>, Bojan Jovanovic <pgbojan(at)bjovanovic(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3269: PSQL does not display error output
Date: 2007-05-12 20:52:39
Message-ID: 26456.1179003159@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Bojan Jovanovic <bjovanovic(at)bjovanovic(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Salvador 2007-05-13 06:02:42 BUG #3273: Installation fails near to finish
Previous Message Bojan Jovanovic 2007-05-12 18:15:15 Re: BUG #3269: PSQL does not display error output