Re: Allow escape in application_name - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Allow escape in application_name
Date
Msg-id 8142b1f5-9792-75be-5236-c55e36f37025@oss.nttdata.com
Whole thread Raw
In response to RE: Allow escape in application_name  ("kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>)
Responses RE: Allow escape in application_name  ("kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>)
List pgsql-hackers

On 2021/10/04 21:53, kuroda.hayato@fujitsu.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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Role Self-Administration
Next
From: Simon Riggs
Date:
Subject: Re: Next Steps with Hash Indexes