I would like to obtain the path to pg_hba.conf from the shell. The path varies between versions of PostgreSQL. For instance, for 8.4 and 9.1:
/etc/postgresql/8.4/main/pg_hba.conf
/etc/postgresql/9.1/main/pg_hba.conf
I have tried the pg_config
command, but it does not seem to include this information.
This is so that I can use a uniform command for opening pg_hba.conf
and other PostgreSQL configuration files for editing.
I'm using bash.