On 3/6/19 8:41 PM, Andres Freund wrote: > Hi, > > On 2019-03-06 20:37:39 +0100, Tomas Vondra wrote: >> Not sure how to integrate it into the CLI tool, though. Perhaps we it >> could require connection info so that it can execute a function, when >> executed in online mode? > > To me the right fix would be to simply have this run as part of the > cluster / in a function. I don't see much point in running this outside > of the cluster. >
Not sure. AFAICS that would to require a single transaction, and if we happen to add some sort of throttling (which is a feature request I'd expect pretty soon to make it usable on live clusters) that might be quite long-running. So, not great. If we want to run it from the server itself, then I guess a background worker would be a better solution. Incidentally, that's something I've been toying with some time ago, see [1]. [1] https://github.com/tvondra/scrub -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services