Received: from post.webmailer.de (natpost.webmailer.de [192.67.198.65]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAON6Vm52090 for ; Sat, 24 Nov 2001 18:06:31 -0500 (EST) (envelope-from barwick@gmx.net) Received: from there (pD9E0EB09.dip.t-dialin.net [217.224.235.9]) by post.webmailer.de (8.9.3/8.8.7) with SMTP id AAA00575; Sun, 25 Nov 2001 00:06:30 +0100 (MET) Message-Id: <200111242306.AAA00575@post.webmailer.de> Content-Type: text/plain; charset="iso-8859-1" From: Ian Barwick To: ryan@eidolon.dk, Ryan Rohde Hansen , pgsql-admin@postgresql.org Subject: Re: Problems between Mandrake and pg Date: Sun, 25 Nov 2001 00:06:28 +0100 X-Mailer: KMail [version 1.3.1] References: <3BFBAFA4.541ED1C2@control.auc.dk> In-Reply-To: <3BFBAFA4.541ED1C2@control.auc.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archive-Number: 200111/122 X-Sequence-Number: 2647 Hi On Wednesday 21 November 2001 14:44, Ryan Rohde Hansen wrote: > We are a group studying at Aalborg University. We are at the moment > developing a postgresql-db (7.1.3) on Mandrake 8.0, which we intend to > access via libpq. But at the moment we can't even connect to the db. > The connection is refused and we are asked if the -i option has been set > in the startup of postmaster: > > [01gr551@ika dbkode]$ ./test1 > Connection to host=localhost dbname=01gr551 failed, PQconnectPoll() > -- connect() > failed: Connection refused > Is the postmaster running (with -i) at 'localhost' > and accepting connections on TCP/IP port '5432'? > > The program we are running: > > #include > #include > #include > > int main() > { > > PGconn *conn; > const char *connection_str = "host=localhost dbname=01gr551"; Try leaving out the "host=localhost" part of the above string. If the backend process isn't accepting connections on a TCP/IP port, specifying a host name (even if it's the name of the local machine) forces a connect to the port, which causes the above error. See also: http://www.postgresql.org/idocs/index.php?postmaster-start.html#CLIENT-CONNECTION-PROBLEMS HTH Ian Barwick