On Thu, Feb 22, 2018 at 8:26 PM, Andres Freund <and...@anarazel.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/>

Reply via email to