Re: Allow workers to override datallowconn

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Daniel Gustafsson <daniel(at)yesql(dot)se>
Subject: Re: Allow workers to override datallowconn
Date: 2018-02-22 18:54:31
Message-ID: CABUevEwy12AyGrB5vZdWXV4JJi8BaZ5shrOe3rPAKTkgT3M9yA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 22, 2018 at 7:24 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Magnus Hagander <magnus(at)hagander(dot)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.

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

Attachment Content-Type Size
worker_override_allowconn.c text/x-csrc 9.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-02-22 19:17:34 Re: Allow workers to override datallowconn
Previous Message Alexander Kuzmenkov 2018-02-22 18:42:08 Re: [HACKERS] PoC: full merge join on comparison clause