pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Donald Carlile <carlile@me.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: PQExec returns null question
Date: Mon, 20 Oct 2014 12:28:46 -0700
Message-ID: <1C7ADC29-7929-4D53-AB0B-A6CC5A8263CB@me.com> (raw)
In-Reply-To: <2666.1413826268@sss.pgh.pa.us>
References: <D2BB3EEC-5FA7-4EB3-B232-ADBBC06590B0@me.com>
	<2666.1413826268@sss.pgh.pa.us>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-interfaces>

Tom,
Thanks for the reply. I had thought we were testing for loss of connection before we send a query, but it doesn’t appear that we are. I’ll go back and look at the postmaster log to see if I can find more information. I’ll also check to see if there’s a way to really test connection before we send a query.

Regards,
Don

On Oct 20, 2014, at 10:31 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> 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 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



view thread (3+ messages)

Message-ID: <1C7ADC29-7929-4D53-AB0B-A6CC5A8263CB@me.com>
Permalink:  ../1C7ADC29-7929-4D53-AB0B-A6CC5A8263CB@me.com/
Also on:    postgresql.org/message-id/1C7ADC29-7929-4D53-AB0B-A6CC5A8263CB@me.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: carlile@me.com, tgl@sss.pgh.pa.us
  Subject: Re: PQExec returns null question
  In-Reply-To: <1C7ADC29-7929-4D53-AB0B-A6CC5A8263CB@me.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox