Re: Allow workers to override datallowconn

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: Allow workers to override datallowconn
Дата
Msg-id CABUevExVUZMvQwjMEeX+ZUC1O3ZOjUp71irCCP7XhMEe=puxVg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Allow workers to override datallowconn  (Andres Freund <andres@anarazel.de>)
Ответы Re: Allow workers to override datallowconn
Re: Allow workers to override datallowconn
Список pgsql-hackers
On Thu, Feb 22, 2018 at 8:26 PM, Andres Freund <andres@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.


--

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Allow workers to override datallowconn
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: Online enabling of checksums