RE: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)

Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>

From: "kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>
To: "kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>, 'Fujii Masao' <masao.fujii@oss.nttdata.com>
Cc: "'pgsql-hackers@lists.postgresql.org'" <pgsql-hackers@lists.postgresql.org>, 'Tom Lane' <tgl@sss.pgh.pa.us>
Date: 2021-08-31T07:11:33Z
Lists: pgsql-hackers

Attachments

Dear Fujii-san,

I attached new version, that almost all codes
moved from libpq to postgres_fdw.

Now we can accept four types of escapes.
All escapes will be rewritten to connection souce's information:

* application_name,
* user name,
* database name, and
* backend's pid.

These are cannot be set by log_line_prefix, so I think it is useful.


We can use escape sequences in two ways:
* Sets postgres_fdw.application_name GUC paramter, or
* Sets application_name option in CREATE SERVER command.

Which version do you like?

Best Regards,
Hayato Kuroda
FUJITSU LIMITED

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.