As part of some basic
administration in PostgreSQL databases, we will learn how to check and modify
parameters
there are a few ways to do it
- using the "Show" command
- querying pg_settings catalog
- by directly checking configuration files
Assume you need to check the
parameter related to the hba_configuration file, like the location of this file
but you are not sure about the parameter name, I just tried with a few
options, and it was not giving me proper value, however, it was throwing syntax
error like below
postgres-# show hba_config;
ERROR: syntax error at or near
"show"
LINE 2: show hba_config;
^
postgres=#
postgres=# show hba;
ERROR: unrecognized
configuration parameter "hba"
postgres=#
for using the "show"
command, you must know the exact name of the parameter, or else you can simply
use pg_settings catalog to fetch it, I just tried the
"like" parameter in pg_settings
postgres=# SELECT name, setting,
reset_val FROM pg_settings where name like '%hba%';
name |
setting
|
reset_val
----------+-------------------------------------------------+-------------------------------------------------
hba_file | C:/Program
Files/PostgreSQL/10/data/pg_hba.conf | C:/Program
Files/PostgreSQL/10/data/pg_hba.conf
(1 row)
now you can check using the "show"
command
postgres=# show hba_file;
hba_file
-------------------------------------------------
C:/Program
Files/PostgreSQL/10/data/pg_hba.conf
(1 row)
postgres=# show max_connections;
max_connections
-----------------
100
(1 row)
0 comments:
Post a Comment