Look what your listen address is in postgresql.conf (this is not the
problem but just to check for the record):
listen_addresses = '*'

Put * or 127.0.0.1 or the ip addresses you want to open.

Then, restart the server and test with psql command line tool:

psql prac2 -U lucas -h 127.0.0.1

It should ask you the password and let you in, if not, you still have
a problem with the pg_hba.conf.
This is a example that might work:

local   all         postgres                          ident
local   all         all                               ident
host    all         all         127.0.0.1/32          md5
host    all         all         ::1/128               md5
host       all         all      0.0.0.0/0             md5
hostssl    all         all      0.0.0.0/0             md5

Remove any  line with "ident" method and "host" access type.
Warning: the last two lines open postgresql for all ip addresses (with
password auth)

Best regards,

Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com



On Mon, Sep 26, 2011 at 2:18 PM, lucas <sjluk...@gmail.com> wrote:
> ok, this is what i did to follow Mariano's suggestions:
>
> as root:
>> service iptables stop  // should allow or accept all interfaces and ports
>> cp /usr/pgsql-9.1/share/pg_hba.conf.sample /usr/pgsql-9.1/share/pg_hba.conf
>
> which the previous has the lines in it
> # IPv4 local connections:
> host    all             all             127.0.0.1/32            md5
> hostssl    all             all             127.0.0.1/32            md5
>
> which i restarted postgresql with
>> service postgresql-9.1 restart
> which worked with confirmation
>> service postgresql-9.1 status
>  (pid  18674) is running...
>
> then into as lucas:
>> python
> Python 2.6.5 (r265:79063, Jun 25 2011, 08:36:25)
> [GCC 4.4.4 20100726 (Red Hat 4.4.4-13)] on linux2
>>>>import psycopg2
>>>> psycopg2.connect(database="prac2", user="lucas", 
>>>> password="passwdnotposted", host="localhost")
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> psycopg2.OperationalError: FATAL:  Ident authentication failed for
> user "lucas"
>
> i did the above python stuff after making sure that postgresql had the
> user added and proper password under template1 using psql, the
> database created, and that user had all granted privileges to the
> database.
>
> i can't think of anything else.  suggestions, please?  lucas

Reply via email to