Michael Paquier - PostgreSQL committer

  • Home
  • Manuals
  • Presentations
  • Projects
  • Resume
  • Tags
  • About

Home » manuals » postgresql » parse-config-files

PostgreSQL - Parse Configuration Files

It may be possible that you do not have access to the configuration files of a PostgreSQL server due to some administration permission issues. There are several options available to get a look at the configuration files without having a session on server. There are configuration parameters indicating the place of each configuration file, called config_file, hba_file and ident_file.

postgres=# show config_file;
                config_file                
-------------------------------------------
 $HOME/pgsql/master/postgresql.conf
(1 row)
postgres=# show ident_file;
               ident_file                
-----------------------------------------
 $HOME/pgsql/master/pg_ident.conf
(1 row)
postgres=# show hba_file;
               hba_file                
---------------------------------------
 $HOME/pgsql/master/pg_hba.conf
(1 row)

You can also directly read the file content with queries like:

WITH f(name) AS (VALUES('pg_hba.conf'))
SELECT pg_catalog.pg_read_file(name, 0, (pg_catalog.pg_stat_file(name)).size) FROM f;
SELECT * from pg_catalog.pg_read_file('pg_hba.conf');

Search

Social

Github

RSS Feeds

Main

Postgres

Sponsor

Unless otherwise specified, the contents of this website are (C)Copyright Michael Paquier 2010-2025 and are licensed for use under CC BY-NC-ND 4.0.