Re: Allow escape in application_name

Kyotaro Horiguchi <horikyota.ntt@gmail.com>

From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: masao.fujii@oss.nttdata.com
Cc: kuroda.hayato@fujitsu.com, houzj.fnst@fujitsu.com, ikedamsh@oss.nttdata.com, pgsql-hackers@lists.postgresql.org, tgl@sss.pgh.pa.us
Date: 2021-10-12T06:59:23Z
Lists: pgsql-hackers
At Tue, 12 Oct 2021 15:42:23 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in 
> If we code as the following:
...
>   A. "^-?[0-9]+.*" : same to the current
>   B. "^[^0-9-].*"  : same to the current
>   C. "^-[^0-9].*"  : padding = 0, p doesn't advance.
>   D. "^-"          : padding = 0, p doesn't advance.

One possible cause of a difference in behavior is character class
handling including multibyte characters of isdigit and strtol.  If
isdigit accepts '一' as a digit (some platforms might do this) , and
strtol doesn't (I believe it is universal behavior), '%一0p' is
converted to '%' and the pointer moves onto '一'. But I don't think we
need to do something for such a crazy specification.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



Commits

  1. postgres_fdw: Add regression test for postgres_fdw.application_name GUC.

  2. postgres_fdw: Allow postgres_fdw.application_name to include escape sequences.

  3. doc: Add note about postgres_fdw.application_name.

  4. postgres_fdw: Revert unstable tests for postgres_fdw.application_name.

  5. postgres_fdw: Allow application_name of remote connection to be set via GUC.