Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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.

http://www.enterprisedb.com/docs/en/8.4/pg/runtime-config-file-locations.html#GUC-HBA-FILE

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;
 data_directory  
-----------------
 /var/pgsql/data

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  postmaster.pid
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
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.