RE: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name) - Mailing list pgsql-hackers

From kuroda.hayato@fujitsu.com
Subject RE: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)
Date
Msg-id TYAPR01MB58666157D4FF274822A76B3BF5D29@TYAPR01MB5866.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Responses Re: Allow escape in application_name
Re: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name)
List pgsql-hackers
Dear Fujii-san,

Thank you for updating! Your modification is very interesting and
I learn something new.

> Attached is the updated version of the patch. I removed the test
> for case (1). And I arranged the regression tests so that they are based
> on debug_discard_caches, to simplify them. Also I added and updated
> some comments and docs. Could you review this version?

I agree removing (1) because it is obvious case.

```diff
+-- If appname is set both as GUC and as options of server object,
+-- the GUC setting overrides appname of server object and is used.
+SET postgres_fdw.application_name TO 'fdw_guc_appname';
+SELECT 1 FROM postgres_fdw_disconnect_all();
+ ?column?
+----------
+        1
+(1 row)
+
+SELECT 1 FROM ft1 LIMIT 1;
+ ?column?
+----------
+        1
+(1 row)
+
+SELECT application_name FROM pg_stat_activity
+       WHERE application_name IN ('loopback2', 'fdw_guc_appname');
+ application_name
+------------------
+ fdw_guc_appname
+(1 row)
```

I think we should SELECT ft6 because foreign server 'loopback'
doesn't have application_name server option.

I have no comments anymore.

Best Regards,
Hayato Kuroda
FUJITSU LIMITED




pgsql-hackers by date:

Previous
From: "houzj.fnst@fujitsu.com"
Date:
Subject: RE: Skipping logical replication transactions on subscriber side
Next
From: Sasasu
Date:
Subject: Re: storing an explicit nonce