pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Keary Suska <hierophant@pcisys.net>
To: Postgres-Interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: PQconnectdb et.all.
Date: Tue, 04 Apr 2006 13:41:20 -0700
Message-ID: <C0582800.27DA3%hierophant@pcisys.net> (raw)
In-Reply-To: <E1FQn9o-000Am9-Is@cs1.cs.huji.ac.il>

on 4/4/06 8:09 AM, danny@cs.huji.ac.il purportedly said:

> How can I programatically figure out why PQconnectdb failed?
> The reason for this is that my daemon needs to know:
> 1- if to try and reconnect (for example, if it's timing out)
> 2- abandom, if for example it has not permition.

If your question is whether you can reliably parse the result of
PQerrorMessage and determine a course of action, I think the answer is "kind
of." My understanding is that these error messages are just a human-friendly
indicator and are subject to change. You might be able to check "errno", but
I can't say whether that will be informative (depends on what libpq does in
its depths, scoping issues, among other things).

That being said, you could try to catalog the common messages and behave
accordingly, but with the caveat that future versions may change the
messages.

Hope this helps,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"




view thread (4+ messages)  latest in thread

Message-ID: <C0582800.27DA3%hierophant@pcisys.net>
Permalink:  ../C0582800.27DA3%25hierophant@pcisys.net/
Also on:    postgresql.org/message-id/C0582800.27DA3%hierophant@pcisys.net

 · 

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: hierophant@pcisys.net
  Subject: Re: PQconnectdb et.all.
  In-Reply-To: <C0582800.27DA3%hierophant@pcisys.net>

* 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