Edit file hpg_hba.conf

At a guess, you've tried to edit the file in a directory that doesn't actually exist, because the path on your system is different. It'd help if you showed the exact command you ran, the exact error message text, your version of PostgreSQL and how you installed Pg (Homebrew, EnterpriseDB packages, etc).

To edit pg_hba.conf - PostgreSQL Client Authentication Configuration File:

In psql, run:

SHOW hba_file;
and see what location it reports. That's the file you must edit. If you can't get into psql you must locate it in the file system; try:
cd
sudo find / -name pg_hba.conf
When you've found the correct path, you don't need to use su to edit it from a postgres login; just use:

sudo vim /path/to/pg_hba.conf
eg on my system:

sudo vim /usr/local/pgsql/data/pg_hba.conf
If you prefer to use a different editor, anything that can run from the command line should work, including most GUI editors.

Post a Comment

Previous Post Next Post