Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm trying to make it so that local connections to the database don't require a login. So I added the line local all all trust to the pg_hba.conf file, but then when I load pgAdmin and try to connect to the server it just says FATAL: could not load pg_hba.conf. What am I doing wrong?

share|improve this question
    
Post the lines from your pg_hba.conf that are not commented out (obfuscate any personally identifiable networks/hosts if you like). –  bma Aug 21 '13 at 0:43
3  
Also, look in the db log, there could be a line just before that FATAL message giving an indication what the problem is, eg. a bad entry in the file. –  bma Aug 21 '13 at 0:49
    
Is pgAdmin running on the same machine as the server? Is the Postgres server running and only pgAdmin complaining? –  Erwin Brandstetter Aug 21 '13 at 9:57
add comment

2 Answers

There is likely an invalid entry in pg_hba.conf file. Reload it and then check the PostgreSQL server log for any pg_hba.conf error:

pg_ctl reload -D $PGDATA
share|improve this answer
add comment

The problem is that this postgres version under win7 can not handle local connections. I had to work with pg very urgently on my local computer so I did not care too much about security so maybe this is not the best solution for a live environment. But my local PC it was enough.

I removed all other uncommented lines from pg_hba.conf and left in only the following one:

host    all             all             ::1/0                 trust

After this I could connect via command line.

I do not understand why the manual tells no more about this issue. I am pretty sure many people have problem with this.

share|improve this answer
2  
"postgres version under win7 can not handle local connections" - that's plain wrong. –  a_horse_with_no_name Feb 11 at 22:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.