Configure autovacuum_vacuum_scale_factor on a PG table

14 views
Skip to first unread message

Jordan Pittier

unread,
Dec 4, 2019, 7:13:31 AM12/4/19
to sqlalchemy
Hi,
I am looking for a way to describe, in my Python model, that a table should have autovacuum_vacuum_scale_factor and autovacuum_analyze_scale_factor set to a non-default value. Similar to what the following statement would do:

ALTER TABLE public.XX SET (autovacuum_vacuum_scale_factor = 0.1);
ALTER TABLE public.YY SET (autovacuum_analyze_scale_factor = 0.05);

Any chance you would know how to do that ?
Thanks
Jordan

Simon King

unread,
Dec 4, 2019, 7:31:31 AM12/4/19
to sqlal...@googlegroups.com
I don't think there's any built-in support for that, but you could
certainly do it by listening for the "after_create" table event. See
the first example at:

https://docs.sqlalchemy.org/en/13/core/events.html#sqlalchemy.events.DDLEvents

Hope that helps,

Simon

Jordan Pittier

unread,
Dec 23, 2019, 5:12:23 AM12/23/19
to sqlalchemy
Thanks ! It helped :)
Reply all
Reply to author
Forward
0 new messages