Postgres find configuration files in linux

S.Hossein Asadollahi picture S.Hossein Asadollahi · Dec 13, 2017 · Viewed 10.8k times · Source

I've spent lots of time to find Postgres configuration files like pg_hba.conf or postgresql.conf in different distributions of linux and also postgres versions itself! and I was very confused...

Answer

S.Hossein Asadollahi picture S.Hossein Asadollahi · Dec 13, 2017

Finally I found the global solution for it.

First you should follow these steps:

  1. su - postgres
  2. psql
  3. For postgres configuration file:

    SHOW config_file;

the output should be like this:

postgres=# SHOW config_file;
                   config_file
    ------------------------------------------
     /etc/postgresql/9.6/main/postgresql.conf
    (1 row)

and for hba_file use:

SHOW hba_file;