Re: libpq ssl -> clear fallback looses error messages

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: libpq ssl -> clear fallback looses error messages
Date: 2008-10-11 21:42:18
Message-ID: 48F11DBA.6010806@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander wrote:
> Tom Lane wrote:
>> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>>> Tom Lane wrote:
>>>> Maybe the answer is to not throw away the first error message? But
>>>> presenting both messages could be confusing too.
>>> Do we have the infrastructure to report more than one error? I thought
>>> we didn't...
>> I was thinking of merging the reports into a single PGresult. The
>> tricky part is to figure out how to present it, and also when to throw
>> away one of the two reports --- if one is obviously bogus you don't want
>> to distract the user with it.
>
> Um, PGresult? These errors occur on connection, so it needs to go in PGconn.
>
> I guess the easy way would be to just append the error reports with a \n
> between them. I think it would be good to keep both error messages in
> *all* cases. If the second connection succeeds, you will not get the
> error condition anyway, and thus not look at the error message from the
> first one.

Here's an ugly attempt towards this. Though I'm unsure if we can change
the "const" on the PQerrorMessage parameter without messing with library
versions and such?

Another option could be to change all the calls that set the error
message to *append* to the error message instead. Thoughts on that?

//Magnus

Attachment Content-Type Size
libpq_err.patch text/x-diff 4.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-10-11 23:03:48 Re: recursive query crash
Previous Message Ian Caulfield 2008-10-11 20:27:19 Re: Window Functions patch v06