On Wed, Dec 4, 2019 at 12:13 PM Jordan Pittier <jor...@gorgias.io> wrote: > > 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
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 -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/CAFHwexc5vp%2BSR9JP%2BzRWWKpW9z5DUNQhGyvg4Sq2MmxyGAS1LA%40mail.gmail.com.