Re: PQExec returns null question
Donald Carlile <[email protected]> Mon, 20 Oct 2014 12:28:46 -0700
| Newsgroups | gmane.comp.db.postgresql.interfaces |
|---|---|
| Message-ID | <[email protected]> |
Tom, Thanks for the reply. I had thought we were testing for loss of connection = before we send a query, but it doesn=92t appear that we are. I=92ll go back= and look at the postmaster log to see if I can find more information. I=92= ll also check to see if there=92s a way to really test connection before we= send a query. Regards, Don On Oct 20, 2014, at 10:31 AM, Tom Lane <[email protected]> wrote: > Donald Carlile <[email protected]> writes: >> Our OS X application uses PostgreSQL as a back end through pqlib. Some o= f our customers are reporting occasional PGRES_FATAL_ERRORs, but PQresultEr= rorMessage 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. T= he docs say that this shouldn=92t happen except in out of memory conditions= . I am not using any Copy actions. >> I have two broad questions. 1) What can I do to prevent this from happen= ing? 2) If it does happen, how can I remedy it? >=20 > There's a recent bug report > http://www.postgresql.org/message-id/[email protected]= ostgresql.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? >=20 > 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. >=20 > regards, tom lane --=20 Sent via pgsql-interfaces mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-interfaces