I have logged into the PostgreSQL db with psql and want to see the location of config file.
But when I execute SHOW config_file, nothing shows up!
[postgres@bddb06 ~]$ psql -U postgres -d postgres
psql (15.8)
Type "help" for help.
postgres=#
postgres=# select datname from pg_database;
datname
-----------
postgres
template1
template0
(3 rows)
postgres=# select current_database();
current_database
------------------
postgres
(1 row)
postgres=#
postgres=# select version();
version
-----------------------------------------------------------------------------------------------------------------
PostgreSQL 15.8 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22.0.1), 64-bit
(1 row)
postgres=# SHOW CONFIG_FILE
postgres-# SHOW 'CONFIG_FILE'
postgres-# SHOW 'config_file'
postgres-#
Can anyone help?
Steps to Check:
Ensure you have Super User Privileges
Try another query:
SELECT sourcefile FROM pg_file_settings WHERE name = 'config_file';
If those two steps are failed, then you can check it manually:
The postgresql.conf
file is typically found in the data directory
specified during the PostgreSQL installation.
Ref - https://www.postgresql.org/docs/current/runtime-config-file-locations.html