这篇文章主要介绍了postgresql 中的参数查看和修改方式,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧。
1.查看参数文件的位置
使用show 命令查看,比较常用的show config_file.此还可以查看pg_settings数据字典.
test=# show config_file;
config_file
------------------------------
/data/pgdata/postgresql.conf
(1 row)
test=# show hba_file
test-# ;
hba_file
--------------------------
/data/pgdata/pg_hba.conf
(1 row)
test=# show ident_file ;
ident_file
----------------------------
/data/pgdata/pg_ident.conf
2.查看当前会话的参数值
可以使用show命令或者查看pg_settings字典.
使用show all可以查看全部的参数值.show 参数名查看指定参数
test=# show all;
-------------------------------------+------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------
allow_system_table_mods | off | Allows modifications of the structure of system tables.
application_name | psql | Sets the application name to be reported in statistics and logs.
archive_command | test ! -f /data/archive/%f && cp %p /data/archive/%f | Sets the shell command that will be called to archive a WAL file.
archive_mode | on | Allows archiving of WAL files using archive_command.
archive_timeout | 0 | Forces a switch to the next WAL file if a new file has not been started within N seconds.
array_nulls | on | Enable input of NULL elements in arrays.
...
test=# show work_mem;
work_mem
----------