Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reset storage parameters of a table

Tags:

postgresql

I have below settings for the table. Instead of using table level setting, I want the table to use SYSTEM / Server level autovacuum settings. Is that possible?

# 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)

Basically it should look like below

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


like image 577
Dhirendra Patil Avatar asked Jan 18 '19 03:01

Dhirendra Patil


1 Answers

The column reloptions of pg_class contains storage parameters. You can set or reset these parameters using alter table, .e.g:

alter table test reset (autovacuum_analyze_scale_factor, autovacuum_analyze_threshold)
like image 94
klin Avatar answered Sep 28 '22 07:09

klin