Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a pg_hba.conf.sample file, but no pg_hba.conf file. I want to make one and put it in the right place. Where do I put pg_hba.conf?

share|improve this question
up vote 0 down vote accepted

According to EnterpriseDB documentation (Chapter 18.2 File locations):

By default, all three configuration files are stored in the database cluster's data directory.

have a look in your postgres.conf for the 'data_directory' setting

another way to get the location of your data_directory is to execute a SQL query with admin privileges

For example:

postgres=# SHOW data_directory;

and it might look as follows:

[root@host /var/pgsql/data]# ls
base    pg_clog      pg_ident.conf  pg_notify  pg_stat_tmp  pg_tblspc    PG_VERSION  postgresql.conf
global  pg_hba.conf  pg_multixact   pg_serial  pg_subtrans  pg_twophase  pg_xlog     postmaster.opts

If the pg_hba.conf is not present here, put it into the directory which has been provided by the SHOW data_directory SQL query

share|improve this answer

Your Answer


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.