libpq should append auth failures, not overwrite

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: libpq should append auth failures, not overwrite
Date: 2018-08-09 15:44:27
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I noticed that, although most error reports during libpq's connection
setup code append to conn->errorMessage, the ones in fe-auth.c and
fe-auth-scram.c don't: they're all printfPQExpBuffer() not
appendPQExpBuffer(). This seems wrong to me. It makes no difference
in simple cases with a single target server, but as soon as you have
multiple servers listed in "host", this coding makes it impossible
to tell which server rejected your login.

So I think we should basically s/printfPQExpBuffer/appendPQExpBuffer/g
anywhere those files touch conn->errorMessage, allowing any problems
with previous servers to be preserved in the eventually-reported message.
I won't bother posting an actual patch for that right now, but has anyone
got an objection?

regards, tom lane


Browse pgsql-hackers by date

  From Date Subject
Next Message Raúl Marín Rodríguez 2018-08-09 15:53:35 Re: Do all rows from a set have the same TupleDesc?
Previous Message Bossart, Nathan 2018-08-09 15:27:04 Re: Improve behavior of concurrent TRUNCATE