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>
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>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Subject: RE: Allow escape in application_name
Date: 2021-12-27 06:19:10
Message-ID: TYAPR01MB5866904D5CEED7229744DB88F5429@TYAPR01MB5866.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Fujii-san,

> Attached is the patch that adds the regression test for
> postgres_fdw.application_name. Could you review this?
>
> As Horiguchi-san suggested at [1], I split the test into two, and then tweaked them
> as follows.
>
> 1. Set application_name option of a server option to 'fdw_%d%p'
> 2. Set postgres_fdw.application_name to 'fdw_%a%u%%'
>
> 'fdw_%d%p' and 'fdw_%a%u%%' still may be larger than NAMEDATALEN
> depending on the regression test environment. To make the test stable even in
> that case, the patch uses substring() is truncate application_name string in the
> test query's condition to less than NAMEDATALEN.

I think it's good because we can care about max_identifier_length,
and both of setting methods are used.
Also it's smart using pg_terminate_backend().
(Actually I'm writing a test that separates test cases into five parts, but
your patch is better.)

I think the test failure should be noticed by me, but I missed, sorry.
Do you know how to apply my patch and test by buildfarm animals?

Best Regards,
Hayato Kuroda
FUJITSU LIMITED

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2021-12-27 07:45:06 Fwd: Schema variables - new implementation for Postgres 15
Previous Message Fujii Masao 2021-12-27 04:39:54 Re: Allow escape in application_name