RE: Allow escape in application_name

From: "kuroda(dot)hayato(at)fujitsu(dot)com" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: '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>, "masao(dot)fujii(at)oss(dot)nttdata(dot)com" <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Subject: RE: Allow escape in application_name
Date: 2021-09-14 04:42:14
Message-ID: TYAPR01MB586691E79BBEF74406347590F5DA9@TYAPR01MB5866.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Horiguchi-san,

Thank you for giving comments!

> Thanks for the new version. I don't object for reusing
> process_log_prefix_padding, but I still find it strange that the
> function with the name 'process_padding' is in string.c. If we move
> it to string.c, I'd like to name it "pg_fast_strtoi" or something and
> change the interface to int pg_fast_strtoi(const char *p, char
> **endptr) that is (roughly) compatible to strtol. What do (both) you
> think about this?

I agree that this interface might be confused.
I changed its name and interface. How do you think?
Actually I cannot distinguish the name is good or not,
but I could not think of anything else...

> I didn't fully checked in what case parse_pgfdw_appname gives "" as
> result, I feel that we should use the original value in that
> case. That is,
>
> > parse_pgfdw_appname(&buf, vaues[i]);
> >
> > /* use the result if any, otherwise use the original string */
> > if (buf.data[0] != 0)
> > values[i] = buf.data;
> >
> > /* break if it results in non-empty string */
> > if (values[0][0] != 0)
> > break;

Hmm. I tested log_line_prefix() by setting it as '%z'
and I found that any prefixes were not output.
I think we should follow it, so currently not fixed.

Best Regards,
Hayato Kuroda
FUJITSU LIMITED

Attachment Content-Type Size
v15_0002_allow_escapes.patch application/octet-stream 15.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2021-09-14 04:56:52 Re: straightening out backend process startup
Previous Message Amit Kapila 2021-09-14 04:28:01 Re: Added schema level support for publication.