Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: ignore TCP/IP question



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. ??

http://www.postgresql.org/docs/8.3/static/auth-pg-hba-conf.html

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:

http://www.postgresql.org/docs/8.3/static/runtime-config-connection.html#GUC-LISTEN-ADDRESSES

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.

-selena

-- 
Selena Deckelmann
PDXPUG - Portland PostgreSQL Users Group
http://pugs.postgresql.org/pdx
http://www.chesnok.com/daily



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group