Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XgGnc-0000bM-Ne for pgsql-interfaces@arkaria.postgresql.org; Mon, 20 Oct 2014 17:31:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XgGnc-0008By-84 for pgsql-interfaces@arkaria.postgresql.org; Mon, 20 Oct 2014 17:31:16 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XgGnb-0008Bs-Jj for pgsql-interfaces@postgresql.org; Mon, 20 Oct 2014 17:31:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XgGnY-0003hZ-CK for pgsql-interfaces@postgresql.org; Mon, 20 Oct 2014 17:31:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s9KHV8P9002667; Mon, 20 Oct 2014 13:31:08 -0400 From: Tom Lane To: Donald Carlile cc: pgsql-interfaces@postgresql.org Subject: Re: PQExec returns null question In-reply-to: References: Comments: In-reply-to Donald Carlile message dated "Mon, 20 Oct 2014 09:53:20 -0700" Date: Mon, 20 Oct 2014 13:31:08 -0400 Message-ID: <2666.1413826268@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-interfaces Precedence: bulk Sender: pgsql-interfaces-owner@postgresql.org Donald Carlile 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 memory conditions. 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 -- Sent via pgsql-interfaces mailing list (pgsql-interfaces@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-interfaces