X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B865832A327 for ; Sat, 2 Oct 2004 00:13:39 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 88729-05 for ; Fri, 1 Oct 2004 23:13:36 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 761F832A305 for ; Sat, 2 Oct 2004 00:13:37 +0100 (BST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id i91NDUpP015826; Fri, 1 Oct 2004 19:13:30 -0400 (EDT) To: Carlos Hasan Cc: pgsql-interfaces@postgresql.org Subject: Re: PQerrorMessage() bug? In-reply-to: <1096330311.4871.11.camel@debian.acepta.com> References: <1096330311.4871.11.camel@debian.acepta.com> Comments: In-reply-to Carlos Hasan message dated "Mon, 27 Sep 2004 20:11:51 -0400" Date: Fri, 01 Oct 2004 19:13:30 -0400 Message-ID: <15825.1096672410@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/4 X-Sequence-Number: 5099 Carlos Hasan 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: <<> > 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