Re: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-09-07 Thread Fujii Masao
On 2021/09/08 7:46, Tom Lane wrote: Fujii Masao writes: Pushed 0001 patch. Thanks! The buildfarm shows that this test case isn't terribly reliable. Yes... Thanks for reporting this! TBH, I think you should just remove the test case altogether. It does not look useful enough to

Re: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-09-07 Thread Tom Lane
Fujii Masao writes: > Pushed 0001 patch. Thanks! The buildfarm shows that this test case isn't terribly reliable. TBH, I think you should just remove the test case altogether. It does not look useful enough to justify a permanent expenditure of testing cycles, never mind the amount of effort

RE: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-09-07 Thread kuroda.hay...@fujitsu.com
Dear Fujii-san, Ikeda-san, > Pushed 0001 patch. Thanks! I confirmed your commit. Thanks! I attached the rebased version. Tests and descriptions were added. In my understanding Ikeda-san's indication is included. Best Regards, Hayato Kuroda FUJITSU LIMITED v10_0002_allow_escapes.patch

Re: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-09-06 Thread Fujii Masao
On 2021/09/07 10:32, kuroda.hay...@fujitsu.com wrote: Dear Fujii-san, I confirmed it and I think it's OK. Other comments should be included in 0002. Pushed 0001 patch. Thanks! Could you rebase 0002 patch? Regards, -- Fujii Masao Advanced Computing Technology Center Research and

RE: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-09-06 Thread kuroda.hay...@fujitsu.com
Dear Fujii-san, I confirmed it and I think it's OK. Other comments should be included in 0002. Best Regards, Hayato Kuroda FUJITSU LIMITED

Re: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-09-06 Thread Fujii Masao
On 2021/09/06 10:32, kuroda.hay...@fujitsu.com wrote: I think we should SELECT ft6 because foreign server 'loopback' doesn't have application_name server option. Yes. I forgot to update that... Thanks for the review! Attached is the updated version of the patch. Regards, -- Fujii Masao

RE: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-09-05 Thread kuroda.hay...@fujitsu.com
Dear Fujii-san, Thank you for updating! Your modification is very interesting and I learn something new. > Attached is the updated version of the patch. I removed the test > for case (1). And I arranged the regression tests so that they are based > on debug_discard_caches, to simplify them. Also

Re: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-09-03 Thread Fujii Masao
On 2021/09/03 14:56, kuroda.hay...@fujitsu.com wrote: Dear Fujii-san, Thank you for your great works. Attached is the latest version. Thanks a lot! I set four testcases: (1) Sets neither GUC nor server option (2) Sets server option, but not GUC (3) Sets GUC but not server option (4)

RE: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-09-02 Thread kuroda.hay...@fujitsu.com
Dear Fujii-san, Thank you for your great works. Attached is the latest version. > Thanks! What about updating the comments furthermore as follows? > > - > Use pgfdw_application_name as application_name if set. > > PQconnectdbParams() processes the parameter

Re: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-09-02 Thread Fujii Masao
On 2021/09/02 18:27, kuroda.hay...@fujitsu.com wrote: I added the following comments: ```diff - /* Use "postgres_fdw" as fallback_application_name. */ + /* +* Use pgfdw_application_name as application_name. +* +*

RE: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-09-02 Thread kuroda.hay...@fujitsu.com
Dear Fujii-san, Thank you for reviewing! > This GUC parameter should be set after the options of foreign server > are set so that its setting can override the server-level ones. > Isn't it better to comment this? I added the following comments: ```diff - /* Use "postgres_fdw" as

Re: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-09-01 Thread Fujii Masao
On 2021/09/01 19:04, kuroda.hay...@fujitsu.com wrote: OK, I split and attached like that. 0001 adds new GUC, and 0002 allows to accept escapes. Thanks for splitting and updating the patches! Here are the comments for 0001 patch. - /* Use "postgres_fdw" as

RE: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-09-01 Thread kuroda.hay...@fujitsu.com
Dear Fujii-san, > Can we split the patch into two as follows? If so, we can review > and commit them one by one. > > #1. Add application_name GUC into postgres_fdw > #2. Allow to specify special escape characters in application_name that > postgres_fdw uses. OK, I split and attached like that.

Re: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-08-31 Thread Fujii Masao
On 2021/08/31 16:11, kuroda.hay...@fujitsu.com wrote: Dear Fujii-san, I attached new version, that almost all codes moved from libpq to postgres_fdw. Thanks for updating the patch! Can we split the patch into two as follows? If so, we can review and commit them one by one. #1. Add

RE: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-08-31 Thread kuroda.hay...@fujitsu.com
Dear Fujii-san, I attached new version, that almost all codes moved from libpq to postgres_fdw. Now we can accept four types of escapes. All escapes will be rewritten to connection souce's information: * application_name, * user name, * database name, and * backend's pid. These are cannot be

RE: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-08-26 Thread kuroda.hay...@fujitsu.com
Dear Fujii-san, Thank you for replying! I attached new version. > Why did you make even %u and %d available in application_name? Actually no particular reason. I added them because they can easily add... And I agree what you say, so removed. > So some people may want to specify their own ID in

Re: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-08-19 Thread Fujii Masao
On 2021/08/05 12:18, kuroda.hay...@fujitsu.com wrote: Dear Hackers, Tom, (I changed subject because this is no longer postgres_fdw's patch) What would be better to think about is how to let users specify this kind of behavior for themselves. I think it's possible to set application_name

Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

2021-08-04 Thread kuroda.hay...@fujitsu.com
Dear Hackers, Tom, (I changed subject because this is no longer postgres_fdw's patch) > > What would be better to think about is how to let users specify this > > kind of behavior for themselves. I think it's possible to set > > application_name as part of a foreign server's connection options,