gpt4 book ai didi

postgresql - 如何重置表的存储参数

转载 作者:行者123 更新时间:2023-11-29 13:11:21 25 4
gpt4 key购买 nike

我对表格进行了以下设置。我不希望使用表级设置,而是希望表使用 SYSTEM/服务器级 autovacuum 设置。这可能吗?

# select pg_options_to_table(reloptions) from pg_class where relname='test' ;
pg_options_to_table
----------------------------------------
(autovacuum_analyze_scale_factor,0)
(autovacuum_analyze_threshold,1000000)
(autovacuum_vacuum_cost_delay,0)
(autovacuum_vacuum_scale_factor,0)
(autovacuum_vacuum_threshold,1000000)
(autovacuum_enabled,true)

基本上它应该如下所示

 select pg_options_to_table(reloptions) from pg_class where relname='test' ;
pg_options_to_table
---------------------
(0 rows)


最佳答案

专栏reloptions of pg_class包含 storage parameters .您可以使用 alter table 设置或重置这些参数,例如:

alter table test reset (autovacuum_analyze_scale_factor, autovacuum_analyze_threshold)

关于postgresql - 如何重置表的存储参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54247366/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com