RE: Allow escape in application_name

From: "kuroda(dot)hayato(at)fujitsu(dot)com" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'Fujii Masao' <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, 'Kyotaro Horiguchi' <horikyota(dot)ntt(at)gmail(dot)com>
Cc: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>, "ikedamsh(at)oss(dot)nttdata(dot)com" <ikedamsh(at)oss(dot)nttdata(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "tgl(at)sss(dot)pgh(dot)pa(dot)us" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: RE: Allow escape in application_name
Date: 2021-12-10 07:35:04
Message-ID: TYAPR01MB58661E99D3D4F33333656F8DF5719@TYAPR01MB5866.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
v25_0002_allow_escapes.patch application/octet-stream 9.5 KB
v25_0001_update_descriptions.patch application/octet-stream 935 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Sharma 2021-12-10 08:39:57 Re: WIP: WAL prefetch (another approach)
Previous Message Peter Eisentraut 2021-12-10 07:06:14 Remove pg_strtouint64(), use strtoull() directly