Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7FF87476744 for ; Tue, 1 Oct 2002 22:45:33 -0400 (EDT) Received: from ttp.co.nz (210-55-57-112.adsl.xtra.co.nz [210.55.57.112]) by postgresql.org (Postfix) with ESMTP id 601DA4758F1 for ; Tue, 1 Oct 2002 22:45:31 -0400 (EDT) Received: from kant.catalyst.net.nz (d40.akld.ttp.co.nz [10.2.0.40]) by ttp.co.nz (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id OAA20202; Wed, 2 Oct 2002 14:45:18 +1200 X-Authentication-Warning: ttp.co.nz: Host d40.akld.ttp.co.nz [10.2.0.40] claimed to be kant.catalyst.net.nz Received: from 127.0.0.1 (ident=unknown) by kant.catalyst.net.nz with esmtp (masqmail 0.2.11) id 17wYeW-843-00; Wed, 02 Oct 2002 13:50:16 +1200 Subject: Re: Connecting PostgreSQL db using Pear From: Andrew McMillan To: Devrim GUNDUZ Cc: pgsql-php@postgresql.org In-Reply-To: References: Content-Type: text/plain Organization: Message-Id: <1033523415.20483.62.camel@kant.mcmillan.net.nz> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.1.1 (Preview Release) Date: 02 Oct 2002 13:50:16 +1200 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/10 X-Sequence-Number: 1525 On Tue, 2002-10-01 at 04:59, Devrim GUNDUZ wrote: > Hi all, > > I've been trying to connect to a local PostgreSQL server using Pear, but I > could not succeed: > > Here is the connect string: > > $dsn = "pgsql://$username:$password@tcp($hostname:$port)/$dbname"; > > And all the variables seems to be ok when I print $dsn. > > However, I get the following error: > > "DB Error: connect failed" > > What should I do to correct this? Can you confirm that the postmaster is started with support for TCP connections? It is possible that in other instances you are connecting via unix sockets. I haven't used PEAR myself, but that seems like one possible problem with the sort of connect string above. More information might mean others could provide more help. Cheers, Andrew. -- --------------------------------------------------------------------- Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267 Survey for free with http://survey.net.nz/ ---------------------------------------------------------------------