如果我做对了,设置是分层的:
postgres.conf->
postgres.auto.conf (ALTER SYSTEM)->
ALTER DATABASE(where applicable)->
ALTER USER(where applicable)->
SET SESSION(where applicable)->
SET LOCAL(where applicable)
Run Code Online (Sandbox Code Playgroud)
假设我已经在某个时候enable_seqscan设置了off。SHOW或current_setting(或pg_settings将仅显示当前值。但是要检查为什么我关闭它,我必须检查整个链条。例如,我怀疑有人为每个用户或每个数据库设置了它,或者在auto.conf- 要找到设置的范围,我必须全部检查。否则重置值可能会失败,例如:
vao=# show enable_seqscan;
enable_seqscan
----------------
off
(1 row)
vao=# set enable_seqscan to default;
SET
vao=# show enable_seqscan;
enable_seqscan
----------------
off
(1 row)
Run Code Online (Sandbox Code Playgroud)
因为对于用户vao,或者对于数据库vao,或者更深...
找到当前值的主要来源的捷径是什么? .. 或者最好是设置的所有来源的矩阵。是否有任何界面或猴子黑客?
更新以反映出色的 Abelisto 答案:
source, sourcefile from pg_settings是一个很好的信息来源,我仍然要求一种猴子的方式来检查这些原因:看到database或user在source我必须重新登录 - 显然。因此,在它们实际应用于会话之前,我无法检查它们。本地和会话集都显示了 SESSION(这也很合理),最后我仍然必须逐步将所有层次结构重置为默认值。例如:
vao=# select setting, source, sourcefile …Run Code Online (Sandbox Code Playgroud)