How to find all conf files location in PostgreSQL

In this article, we will see how to find all conf files location in PostgreSQL.

As a DBA, we must know where config files are located in our file system. Following steps are applied to Linux and Windows Operating Systems.

We cant get the config files location is PostgreSQL by using SHOW command, or by querying pg_settings catalog and by searching in Operating system.

Find all conf files location in PostgreSQL:

1. Find postgresql.conf file location in PostgreSQL using show command. Connect to psql and run the below command.

show config_file;

How to find all conf files location in PostgreSQL

2. Find pb_hba.con file location in PostgreSQL using show command. Connect to psql and run the below command.

show hba_file;

3. Find ident.con file location in PostgreSQL using show command. Connect to psql and run the below command.

show ident_file;

4. Find all configuration files in PostgreSQL by querying catalog on Linux.

select name, setting from pg_settings where setting like '%.conf';

5. Find all configuration files in PostgreSQL by querying catalog on Windows.

6. On Linux using find command to postgresql.conf, pg_hba.conf and pg_ident.conf locations.

sudo find -type f \( -name pg\*.conf -o -name postgresql.conf \)