On Thu, Feb 22, 2018 at 7:24 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Magnus Hagander <magnus@hagander.net> writes: > Attached is a patch that adds new Override versions of the functions to > connect to a database from a background worker.
> Another option would be to just add the parameter directly to the regular > connection function, and not create separate functions. But that would make > it an incompatible change. And since background workers are commonly used > in extensions, that would break a lot of extensions out there. I figured > it's probably not worth doing that, and thus added the new functions. What > do others think about that?
Meh. We change exported APIs in new major versions all the time. As long as it's just a question of an added parameter, people can deal with it. You could take the opportunity to future-proof a little by making this option be the first bit in a flags parameter, so that at least future boolean option additions don't require another API break or a whole new set of redundant functions.
Fair enough. In that case, something like the attached?
> Are there any other caveats in doing that this actually makes it dangerous > to just allow bypassing it for extensions?
Don't think so; we autovacuum such DBs anyway don't we?
Yes. We set the freeze ages to 0 but we do run on it.