我对 postgres autovacuum 设置进行了许多更改,例如更改 cost_delay 和 naptime 设置。我不确定我的所有更改是什么——并且想将 autovacuum 设置重置为默认设置。
有没有我可以执行的命令将它们恢复为默认值?
我对 postgres autovacuum 设置进行了许多更改,例如更改 cost_delay 和 naptime 设置。我不确定我的所有更改是什么——并且想将 autovacuum 设置重置为默认设置。
有没有我可以执行的命令将它们恢复为默认值?
您必须重置您更改的每个设置。如果您不记得更改了哪些设置,可以查询pg_settings
所有非默认值:
select name,
setting as current_value,
reset_val,
boot_val as original_default,
sourcefile,
sourceline
from pg_settings
where source <> 'default'
and name like '%autovacuum%';
reset_val
是如果您运行设置将恢复的值reset <name>;
- 这适用于您在当前会话中所做的更改(使用set <name> = ...;
)
我所说original_default
的是该设置的值,如果根本没有指定参数,则应用该设置。
列sourcefile
和sourceline
将帮助您找到更改这些值的位置。如果是这样,postgresql.auto.conf
则设置已更改,alter system
应使用 重置alter system
。
如果它是一个不同的配置文件(例如`postgresql.conf),你将需要编辑它被改变的文件。