4

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?

  • 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
2

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
  • $ pg_ctl reload -D $PGDATA pg_ctl: option requires an argument -- 'D' Try "pg_ctl --help" for more information. – Mona Jalal Sep 8 '16 at 18:18
0

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.

  • 2
    "postgres version under win7 can not handle local connections" - that's plain wrong. – a_horse_with_no_name Feb 11 '14 at 22:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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