Re: chomp PQerrorMessage() in backend uses

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: chomp PQerrorMessage() in backend uses
Date: 2017-02-08 16:00:09
Message-ID: 1733.1486569609@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
> Here is a patch to systematically trim the trailing newlines off
> PQerrorMessage() results in backend uses (dblink, postgres_fdw,
> libpqwalreceiver).

+1

> I noticed that there are some inconsistent assumptions about whether
> PQerrorMessage() can ever return NULL. From the code, I think that
> should not be possible, but some code appears to be prepared for it.
> Other code is not. What is correct?

libpq.sgml doesn't specify, so it's hard to argue that either position
is "correct". I don't mind resolving the ambiguity via a documentation
change though. I'd want to see it also cover other corner cases like
what if there hasn't been an error on the connection.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-02-08 16:06:17 Re: GSoC 2017
Previous Message Robert Haas 2017-02-08 15:59:29 Re: Parallel bitmap heap scan