Re: connection fails

From: Keary Suska <hierophant(at)pcisys(dot)net>
To: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: connection fails
Date: 2001-09-21 20:45:54
Message-ID: B7D10322.37CF%hierophant@pcisys.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Postgres already gave you the first idea:

> failed: Connection refused Is the postmaster running (with -i) at
> \'localhost\' and accepting connections on TCP/IP port 5432? in
> /var/www/sts.twcable.com/launch_plan/test/c.php on line 3
> failed

Since you are using TCP to connect, have you verified that postmaster is
actually listening and on the expected port? It doesn't by default--by
default it uses a unix domain socket. You have to specify TCP using the -i
option.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"

> From: paula(at)cyberlazarus(dot)net
> Reply-To: paula(at)cyberlazarus(dot)net
> Date: 21 Sep 2001 19:25:25 -0000
> To: pgsql-general(at)postgresql(dot)org
> Subject: [GENERAL] connection fails
>
> Hello,
>
> I\'m trying to connect using an extremely simple php script:
>
> $conn = pg_Connect(\"host=localhost dbname=db name user=postgres
> password=postgres\");
>
> if ($conn) { echo \"ok\"; }
> else { echo \"failed\"; }
>
> I get this error message:
>
> Warning: Unable to connect to PostgreSQL server: connectDBStart() -- connect()
>
> I also tried to work from the command line and get similar error messages.
> The weird thing is that phpPgAdmin is working fine and this script works:
>
> $database = pg_Connect (\"dbname=dbname\");
> pg_exec ($database, \"begin\");
> $oid = pg_locreate ($database);
> echo (\"$oid\\n\");
> $handle = pg_loopen ($database, $oid, \"w\");
> echo (\"$handle\\n\");
> pg_lowrite ($handle, \"gaga\");
> pg_loclose ($handle);
> pg_exec ($database, \"commit\");
>
> [script coming from php.net]
>
> Any ideas??
>
> thnx!
> /paula
>
>
> ----------------------------------------------------------------
> :: www.nervemail.net :: free access to POP3 accounts
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2001-09-21 21:22:27 Re: connection fails
Previous Message Nick Fankhauser 2001-09-21 20:41:14 Re: connection fails