Re: Pg_hba not using local setting - Mailing list pgsql-general

From Doug McNaught
Subject Re: Pg_hba not using local setting
Date
Msg-id m3d6ktgb05.fsf@varsoon.wireboard.com
Whole thread Raw
In response to Pg_hba not using local setting  (James Hall <James.Hall@RadioShack.com>)
List pgsql-general
James Hall <James.Hall@RadioShack.com> writes:

> Hello,
>
> Running version 7.1, have the following entry in PG_HBA.CONF:
> ---
> Local        all        trust
> Host        all        123.0.0.0        255.255.255.0
> password
> ---
>
> With that setting, anyone can login to the database [via our web based
> interface]
> WITHOUT a valid password. If I change local from trust to password then web
> based users have to enter their specific password to login to the database.
> But none of the backup scripts run because postgres needs a password.
>
> Is this a bug, or do I have a misunderstanding of the local use?

It sounds like you're running the webserver on the same machine as the
database.  If this is true, and if you're not using Java (which
doesn't do local sockets) the client access library is probably using
a local (AF_UNIX) socket to connect, which triggers the "Local" entry
in pg_hba.conf.

If you explicitly tell the webserver to connect using an IP address,
it should come in via a TCP connection and trigger the "Host" line
that you have.

-Doug

pgsql-general by date:

Previous
From: Tony Grant
Date:
Subject: Re: Pg_hba not using local setting
Next
From: Steve Crawford
Date:
Subject: Re: now() AT TIME ZONE interval '-5 hours' returns type interval???