Re: Allow workers to override datallowconn - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: Allow workers to override datallowconn
Date
Msg-id CABUevEwy12AyGrB5vZdWXV4JJi8BaZ5shrOe3rPAKTkgT3M9yA@mail.gmail.com
Whole thread Raw
In response to Re: Allow workers to override datallowconn  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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. 


--
Attachment

pgsql-hackers by date:

Previous
From: Alexander Kuzmenkov
Date:
Subject: Re: [HACKERS] PoC: full merge join on comparison clause
Next
From: Andres Freund
Date:
Subject: Re: Allow workers to override datallowconn