pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Carlos Hasan <chasan@acepta.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: PQerrorMessage() bug?
Date: Fri, 01 Oct 2004 19:13:30 -0400
Message-ID: <15825.1096672410@sss.pgh.pa.us> (raw)
In-Reply-To: <1096330311.4871.11.camel@debian.acepta.com>
References: <1096330311.4871.11.camel@debian.acepta.com>

Carlos Hasan <chasan@acepta.com> writes:
> I think that found a weird bug when PQconnectdb() fails because I
> haven't started PostgreSQL. The function PQerrorMessage() returns the
> message:

> could not connect to server: <<<weird garbage here>>
> Is the server running locally and accepting
> connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.

> Looks like the error message wasn't properly formatted.

I think this is the known problem with GNU libc having a weird
(non-SUS-spec) strerror_r.  There's a workaround in the 8.0 sources
but it doesn't look like anyone's backported it to 7.4.  You can
drop the pqStrerror() code from CVS tip src/port/thread.c into 7.4
if you like (this will not work in general because 7.4 configure doesn't
set STRERROR_R_INT, but it should work for the case you want).

			regards, tom lane



view thread (2+ messages)

Message-ID: <15825.1096672410@sss.pgh.pa.us>
Permalink:  ../15825.1096672410@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15825.1096672410@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, chasan@acepta.com
  Subject: Re: PQerrorMessage() bug?
  In-Reply-To: <15825.1096672410@sss.pgh.pa.us>

* 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