On Sat, Mar 1, 2008 at 1:46 PM, Thomas Keller <kellert(at)ohsu(dot)edu> wrote:
> Well, I investigated the cgi script using DBI and DBD::Pg that was giving
> the error and discovered the connection string was the problem.
> This is still curious, and I'd like to know why but I was able to fix it.
> Here's the old $dsn variable: ## this gave the "can't connect" error.
> my $dsn = 'dbi:Pg:dbname=db_name;host=server_name';
> This fixed the problem:
> my $dsn = 'dbi:Pg:dbname=db_name';
> So maybe there is something not quite right in my pg_hba.conf file. ??
By default, PostgreSQL is only listening for connection requests to
localhost. DBD::Pg's default connection host is localhost.
To change this, you need to do two things:
To have postgresql listen on all local interfaces, you could add:
listen_addresses = '*'
to postgresql.conf. Or you can specify the particular IP addresses.
And then you need to add a line to pg_hba.conf:
host all all 192.168.0.100/32 password
This line would allow connections to any database, by any user coming
from IP address 192.168.0.100 and require a password.
PDXPUG - Portland PostgreSQL Users Group
In response to
pdxpug by date
|Next:||From: Selena Deckelmann||Date: 2008-03-03 22:53:46|
|Subject: PG Day before OSCON - topics?|
|Previous:||From: Thomas Keller||Date: 2008-03-01 21:46:49|
|Subject: ignore TCP/IP question|