You can set various configuration parameters for Postgres by either editing the postgresql.conf
file manually or by calling ALTER SYSTEM
commands. These are two avenues for writing the settings, but how about reading?
➥ Is there a way to query for all the current settings?
I know the settings in the client authentication configuration file pg_hba.conf
can be read with the pg_hba_file_rules
view, like this: table pg_hba_file_rules ;
. Is there something similar for postgresql.conf
?
Best Answer
SHOW ALL
The
SHOW ALL
command displays the current setting of run-time parameters in 3 columns.pg_settings
The
pg_settings
view shows the same items asSHOW ALL
but with additional details, across 17 columns versus 3 columns.pg_file_settings
To read what is stored in the
postgresql.conf
file itself, use the viewpg_file_settings
.If freshly written, this file will hold values that may not yet be in effect within the Postgres server. After writing, the settings must be loaded in one of various ways including a server restart.
Admin tool
Your databased-administration tool may display these settings.
For example, in pgAdmin 4, choose the cluster name (the Postgres installation) in the navigation panel, click the
Dashboard
tab, and in a list bottom panel titledServer activity
, click theConfiguration
tab to see a list of your settings.Writing
By the way… For info about writing these settings with
ALTER SYSTEM
commands, see my Answer on another Question, How to editpostgresql.conf
with pgAdmin 4?.