Re: PQExec returns null question - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: PQExec returns null question
Date
Msg-id 2666.1413826268@sss.pgh.pa.us
Whole thread Raw
In response to PQExec returns null question  (Donald Carlile <carlile@me.com>)
Responses Re: PQExec returns null question
List pgsql-interfaces
Donald Carlile <carlile@me.com> writes:
> Our OS X application uses PostgreSQL as a back end through pqlib. Some of our customers are reporting occasional
PGRES_FATAL_ERRORs,but PQresultErrorMessage returns a blank string. I have looked at the sources, and as far as I can
tell,this condition can only occur when PQExec returns a null. The docs say that this shouldn�t happen except in out of
memoryconditions. I am not using any Copy actions.
 
> I have two broad questions. 1) What can I do to prevent this from happening? 2) If it does happen, how can I remedy
it?

There's a recent bug report
http://www.postgresql.org/message-id/20141019003736.2662.84048@wrigleys.postgresql.org
suggesting that this might happen after a loss of connection.  It'd be a
libpq bug that it's not providing a more useful error message in such a
case, but probably the more interesting question from your standpoint
is why is the server dropping the connection.  Have you looked into the
postmaster log to see if anything gets logged when this happens?

If it's not a connection-loss case then you've found some new bug that
we ought to look into, but without a reproducible test case it's hard
to do much in that line.
        regards, tom lane



pgsql-interfaces by date:

Previous
From: Donald Carlile
Date:
Subject: PQExec returns null question
Next
From: Donald Carlile
Date:
Subject: Re: PQExec returns null question