Re: Allow workers to override datallowconn

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Andres Freund <andres(at)anarazel(dot)de>
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 19:30:02
Message-ID: CABUevExVUZMvQwjMEeX+ZUC1O3ZOjUp71irCCP7XhMEe=puxVg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 22, 2018 at 8:26 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:

> Hi,
>
> On 2018-02-22 20:24:03 +0100, Magnus Hagander wrote:
> > In a background worker you can just set the parameter using
> > SetConfigOption(), no? That seems a lot easier than turning things in to
> a
> > kv pair and back...
>
> Sure, but, it doesn't seem bad to offer the option to only allow this
> for code running as superuser.

> > I can see the point for having such a parameter for pg_upgrade, but I'm
> not
> > sure we'd necessarily want to overload them.
>
> What's the argument against?
>

Complexity for the bgw usecase. It now has to construct a key/value pair
with proper escaping (well, for this one flag it would be easy, but if we
do that wouldn't we also support the other config params? Were you thinking
we'd have *just* tihs one?). Basically taking a data that you have in a
"structured format" in the btw already turning it to a string and then
parsing it back into structured data in the same string.

I think it'd be cleaner to let the bgw initializer pass those as flags. A
"user connection" parameter could still use the booelan in InitPostgres()
of course, and not invent a new things there, but the entry point API could
stay simpler.

I haven't actually looked into what it would look like, so it could be that
I'm overestimating what it'd mean of course.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2018-02-22 19:30:52 Re: Online enabling of checksums
Previous Message Andres Freund 2018-02-22 19:26:46 Re: Allow workers to override datallowconn