Re: [HACKERS] Proposal to add work_mem option to postgres_fdwmodule

Поиск
Список
Период
Сортировка
От Kyotaro HORIGUCHI
Тема Re: [HACKERS] Proposal to add work_mem option to postgres_fdwmodule
Дата
Msg-id 20180830.192445.216279772.horiguchi.kyotaro@lab.ntt.co.jp
обсуждение исходный текст
Ответ на Re: [HACKERS] Proposal to add work_mem option to postgres_fdw module  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
At Mon, 27 Aug 2018 19:38:19 -0700, Michael Paquier <michael@paquier.xyz> wrote in
<20180828023819.GA29157@paquier.xyz>
> On Mon, Aug 27, 2018 at 02:34:31PM -0400, Robert Haas wrote:
> > I like the direction of your thinking, but it seems to me that this
> > would cause a problem if you want to set search_path=foo,bar.
> 
> proconfig already handles such cases, that's what I was coming at.  We
> could reuse most of what it does, no?

IIUC, proconfig is a text array, options is a text, and the
options psql-option is in the format of '-cvar=val -cvar=val...'.
Thus I think we still need something to convert them.

As an experiment, just with the following mod:

contrib/postgres_fdw/option.c
       /* Hide debug options, as well as settings we override internally. */
-      if (strchr(lopt->dispchar, 'D') ||
+      if ((strchr(lopt->dispchar, 'D') &&
+           strcmp(lopt->keyword, "options") != 0) ||
           strcmp(lopt->keyword, "fallback_application_name") == 0 ||

and the following setup:

=# alter server sv1
    options (set options '-csearch_path=\\"hoge,hage\\"\\ -cwork_mem=16MB');

actually works. Converting array representation into the
commandline options format shown above internally might make it
look better a bit..

=# alter server sv1
   options (set options '{"search_path=\"hoge,hage\"",work_mem=16MB}');

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: pg_verify_checksums -d option (was: Re: pg_verify_checksums -roption)
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: Reopen logfile on SIGHUP