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

Re: ignore TCP/IP question

From: "Selena Deckelmann" <selenamarie(at)gmail(dot)com>
To: "Thomas Keller" <kellert(at)ohsu(dot)edu>
Cc: "Postgresql PDX_Users" <pdxpug(at)postgresql(dot)org>
Subject: Re: ignore TCP/IP question
Date: 2008-03-02 18:36:15
Message-ID: 2b5e566d0803021036g7e476c24h9044aad1a941e6a9@mail.gmail.com (view raw or flat)
Thread:
Lists: pdxpug
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

In response to

pdxpug by date

Next:From: Selena DeckelmannDate: 2008-03-03 22:53:46
Subject: PG Day before OSCON - topics?
Previous:From: Thomas KellerDate: 2008-03-01 21:46:49
Subject: ignore TCP/IP question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group