RE: [HACKERS] Proposal to add work_mem option to postgres_fdw module

Поиск
Список
Период
Сортировка
От Shinoda, Noriyoshi (PN Japan GCS Delivery)
Тема RE: [HACKERS] Proposal to add work_mem option to postgres_fdw module
Дата
Msg-id TU4PR8401MB043012F3C5D6410E64611383EE0E0@TU4PR8401MB0430.NAMPRD84.PROD.OUTLOOK.COM
обсуждение исходный текст
Ответ на Re: [HACKERS] Proposal to add work_mem option to postgres_fdw module  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: [HACKERS] Proposal to add work_mem option to postgres_fdw module  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
Eisentraut-san
Thank you for becoming a reviewer.

> The reason is that postgres_fdw filters out connection settings that are marked debug ("D"), and the "options"
keywordis marked as such.  
 
> I think this is wrong.  Just remove that designation and then this will work.  
> (Perhaps filtering out the debug options is also wrong, but I can see an argument for it.)

Certainly the PQconndefaults function specifies Debug flag for the "options" option.
I think that eliminating the Debug flag is the simplest solution. 
For attached patches, GUC can be specified with the following syntax.

CREATE SERVER remsvr1 FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host 'host 1', ..., options '-c work_mem=64MB -c
geqo=off');
ALTER SERVER remsv11 OPTIONS (SET options '-c work_mem=64MB -c geqo=off');

However, I am afraid of the effect that this patch will change the behavior of official API PQconndefaults.

Best Regards,
Noriyoshi Shinoda

-----Original Message-----
From: Peter Eisentraut [mailto:peter.eisentraut@2ndquadrant.com] 
Sent: Friday, August 31, 2018 2:45 AM
To: Shinoda, Noriyoshi (PN Japan GCS Delivery) <noriyoshi.shinoda@hpe.com>; fabriziomello@gmail.com; [pgdg] Robert Haas
<robertmhaas@gmail.com>;michael@paquier.xyz
 
Cc: Pgsql Hackers <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] Proposal to add work_mem option to postgres_fdw module

On 28/08/2018 05:55, Shinoda, Noriyoshi (PN Japan GCS Delivery) 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.
>> ... OPTIONS ( host 'remhost1', port '5433', dbname 'demodb', 
>> option='option1=foo', option='option2=bar' );
> I do not want to allow postgres_fdw to set "all" GUCs. Because I think it is very difficult to check the validity of
allinput values.
 
> So, I attached modified the patch so that we can easily add GUC that we can set to postgres_fdw module.
> If you wish to add more GUC options to the module, add values to the 
> non_libpq_options[] array of the InitPgFdwOptions function, And add the validator code for the GUC in the
postgres_fdw_validatorfunction.
 

We already have a method for libpq applications to pass GUC settings via connection parameters.  And postgres_fdw
supportspassing libpq connection parameters as server options.  So why doesn't this work here?
 

The reason is that postgres_fdw filters out connection settings that are marked debug ("D"), and the "options" keyword
ismarked as such.  I think this is wrong.  Just remove that designation and then this will work.  (Perhaps filtering
outthe debug options is also wrong, but I can see an argument for it.)
 

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: pg_verify_checksums failure with hash indexes
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: remove ancient pre-dlopen dynloader code