pg_hba.conf file

Started by Martin A. Marquesabout 25 years ago4 messagesgeneral
Jump to latest
#1Martin A. Marques
martin@math.unl.edu.ar

I'm currently working on a proyect that has Postgres as the database storage
server, and PHP-4.0.4pl1 as the language to use in comunication with the users.
What I can't get to understand is how PHP comunicates with the database, so that
I can set the correct hba.conf enteries.
PHP will be on the same server as Postgres is, and the pg_hba.conf file contains
this, which I'm not sure is a good configuration:

local all trust
host all 127.0.0.1 255.255.255.255 password
host all 168.96.132.31 255.255.255.0 password
host all 170.210.8.31 255.255.255.0 password

What do you people hear think of this? I'm consurned about the local enterie,
but when I put password instead of trust, I can't login with PHP to the
database.
Any thoughts?

Saludos... ;-)

System Administration: It's a dirty job,
but someone told I had to do it.
-----------------------------------------------------------------
Mart�n Marqu�s email: martin@math.unl.edu.ar
Santa Fe - Argentina http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------

#2Dan Harrington
dan@tudan.net
In reply to: Martin A. Marques (#1)
Error message on pg_dumpall

Hello,
What does this error mean? I'm trying to make a backup of all my databases
and then this
error comes up.

Thanks
Dan

============================================================================
======

bash# pg_dumpall -o >/tmp/db.out
NOTICE: Unrecognized variable client_encoding
NOTICE: Unrecognized variable client_encoding
NOTICE: Unrecognized variable client_encoding
NOTICE: Unrecognized variable client_encoding
/usr/bin/pg_dumpall: createdb: command not found
NOTICE: Unrecognized variable client_encoding
getInherits(): SELECT failed. Explanation from backend: 'ERROR: Attribute
'inhrel' not found
'.
pg_dump failed on goodsalt, exiting

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Martin A. Marques (#1)
Re: pg_hba.conf file

Martin A. Marques writes:

local all trust
host all 127.0.0.1 255.255.255.255 password
host all 168.96.132.31 255.255.255.0 password
host all 170.210.8.31 255.255.255.0 password

What do you people hear think of this? I'm consurned about the local enterie,
but when I put password instead of trust, I can't login with PHP to the
database.

Apparently, your PHP application connects through the 'local' (Unix domain
socket) connection. That means the 'host' entries are irrelevant. Of
course if you set the authentication method to 'password' and don't
actually provide a (correct) password then things aren't going to work.

--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/

#4Peter Eisentraut
peter_e@gmx.net
In reply to: Dan Harrington (#2)
Re: Error message on pg_dumpall

Dan Harrington writes:

bash# pg_dumpall -o >/tmp/db.out
NOTICE: Unrecognized variable client_encoding
NOTICE: Unrecognized variable client_encoding
NOTICE: Unrecognized variable client_encoding
NOTICE: Unrecognized variable client_encoding
/usr/bin/pg_dumpall: createdb: command not found
NOTICE: Unrecognized variable client_encoding
getInherits(): SELECT failed. Explanation from backend: 'ERROR: Attribute
'inhrel' not found
'.
pg_dump failed on goodsalt, exiting

Looks like you're running an old pg_dump with a newer server (or vice
versa, don't recall). You need to use pg_dump from the release that your
server came from.

--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/