RE: Allow escape in application_name
Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
From: "kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>
To: 'Fujii Masao' <masao.fujii@oss.nttdata.com>, 'Kyotaro Horiguchi' <horikyota.ntt@gmail.com>
Cc: "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>, "ikedamsh@oss.nttdata.com" <ikedamsh@oss.nttdata.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>, "tgl@sss.pgh.pa.us" <tgl@sss.pgh.pa.us>
Date: 2021-12-10T07:35:04Z
Lists: pgsql-hackers
Attachments
- v25_0002_allow_escapes.patch (application/octet-stream) patch v25
- v25_0001_update_descriptions.patch (application/octet-stream) patch v25
Dear Fujii-san, I apologize for sending bad patches... I confirmed that it can be built and passed a test. > Could you tell me why you added new paragraph into the middle of existing > paragraph? This change caused the following error when compiling the docs. > > postgres-fdw.sgml:952: parser error : Opening and ending tag mismatch: listitem > line 934 and para > </para> > > How about adding that new paragraph just after the existing one, instead? Fixed. > + /* > + * The parsing result became an empty string, > + * and that means other "application_name" > will be used > + * for connecting to the remote server. > + * So we must set values[i] to an empty string > + * and search the array again. > + */ > + values[i] = ""; > > Isn't pfree() necessary inside the loop also when data[0]=='\0' case? If so, > probably "data" would need to be set to NULL just after pfree(). Otherwise > pfree()'d "data" can be pfree()'d again at the end of connect_pg_server(). I confirmed the source, and I agreed your argument because initStringInfo() allocates memory firstly. Hence pfree() was added. > Thanks! But, since the term "local server" is already used in the docs, we can use > "the setting value of application_name in local server" etc? I like the word "local server," so I reworte descriptions. Best Regards, Hayato Kuroda FUJITSU LIMITED
Commits
-
postgres_fdw: Add regression test for postgres_fdw.application_name GUC.
- 353aa01687b5 15.0 landed
-
postgres_fdw: Allow postgres_fdw.application_name to include escape sequences.
- 6e0cb3dec10e 15.0 landed
-
doc: Add note about postgres_fdw.application_name.
- 58e2e6eb67fe 15.0 landed
-
postgres_fdw: Revert unstable tests for postgres_fdw.application_name.
- 98dbef90eb29 15.0 landed
-
postgres_fdw: Allow application_name of remote connection to be set via GUC.
- 449ab6350526 15.0 landed