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: (view raw or whole 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. ??

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    password

This line would allow connections to any database, by any user coming
from IP address and require a password.


Selena Deckelmann
PDXPUG - Portland PostgreSQL Users Group

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-2015 The PostgreSQL Global Development Group