agora inbox for pgsql-interfaces@postgresql.org  
help / color / mirror / Atom feed
PQExec returns null question
3+ messages / 2 participants
[nested] [flat]

* PQExec returns null question
@ 2014-10-20 16:53 Donald Carlile <carlile@me.com>
  2014-10-20 17:31 ` Re: PQExec returns null question Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Donald Carlile @ 2014-10-20 16:53 UTC (permalink / raw)
  To: pgsql-interfaces

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?

I have increased the shared memory, and that seems to have helped somewhat, but it still occurs. In our experience, once this starts happening, it continues for every subsequent query.  WE have found that restarting the machine will remedy it for a time, but is there a less drastic action we can take that will also remedy it? Perhaps stopping and starting PostgreSQL? Or are system resources being consumed to the level that a system restart is required?

Many Thanks,
Don Carlile

-- 
Sent via pgsql-interfaces mailing list (pgsql-interfaces@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-interfaces



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: PQExec returns null question
  2014-10-20 16:53 PQExec returns null question Donald Carlile <carlile@me.com>
@ 2014-10-20 17:31 ` Tom Lane <tgl@sss.pgh.pa.us>
  2014-10-20 19:28   ` Re: PQExec returns null question Donald Carlile <carlile@me.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2014-10-20 17:31 UTC (permalink / raw)
  To: Donald Carlile <carlile@me.com>; +Cc: 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 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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: PQExec returns null question
  2014-10-20 16:53 PQExec returns null question Donald Carlile <carlile@me.com>
  2014-10-20 17:31 ` Re: PQExec returns null question Tom Lane <tgl@sss.pgh.pa.us>
@ 2014-10-20 19:28   ` Donald Carlile <carlile@me.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Donald Carlile @ 2014-10-20 19:28 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2014-10-20 19:28 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-10-20 16:53 PQExec returns null question Donald Carlile <carlile@me.com>
2014-10-20 17:31 ` Tom Lane <tgl@sss.pgh.pa.us>
2014-10-20 19:28   ` Donald Carlile <carlile@me.com>

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