Cannot find pg_hba.conf and postgreql.conf file on OS X?

I installed postgres using homebrew. I would like to locate he files pg_hba.conf and postgresql.conf but I cannot find them.

I followed this :

https://askubuntu.com/questions/256534/how-do-i-find-the-path-to-pg-hba-conf-from-the-shell

and this

http://www.kelvinwong.ca/tag/pg_hba-conf/

but I still cannot find it.


By default homebrew puts everything in /usr/local

So the postgresql conf files will be /usr/local/var/postgres/


If you can connect to Pg as the superuser (usually postgres) simply SHOW hba_file; to see its location.

Otherwise you have to find out how PostgreSQL is started to locate its data directory.


Worst case, you can search for it:

find / -type f -name pg_hba.conf 2> /dev/null