From: | Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> |
---|---|
To: | "kuroda(dot)hayato(at)fujitsu(dot)com" <kuroda(dot)hayato(at)fujitsu(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-10-05 16:25:00 |
Message-ID: | 8142b1f5-9792-75be-5236-c55e36f37025@oss.nttdata.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 2021/10/04 21:53, kuroda(dot)hayato(at)fujitsu(dot)com wrote:
>> if (*p == '-' ? isdigit(p[1]) : isdigit(p[0]))
>> {
>> char *endptr;
>> padding = strtol(p, &endptr, 10);
>> if (p == endptr)
>> break;
>> p = endptr;
>> }
>> else
>> padding = 0;
>
> I removed the support function based on your suggestion,
> but added some if-statement in order to treats the special case: '%-p'.
+ else if (*p == '-' ? isdigit(p[1]) : isdigit(p[0]))
+ {
+ char *endptr;
+ padding = strtol(p, &endptr, 10);
Maybe isdigit() and strtol() work differently depending on locale setting?
If so, I'm afraid that the behavior of this new code would be different from
process_log_prefix_padding().
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
From | Date | Subject | |
---|---|---|---|
Next Message | Simon Riggs | 2021-10-05 16:28:33 | Re: Next Steps with Hash Indexes |
Previous Message | Robert Haas | 2021-10-05 16:23:33 | Re: Role Self-Administration |