Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLIYs-0000HB-R0 for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Sep 2021 05:13:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mLIYr-0006sJ-IG for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Sep 2021 05:13:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLIYr-0006pe-Ab for pgsql-hackers@lists.postgresql.org; Wed, 01 Sep 2021 05:13:21 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLIYn-00028N-Qb for pgsql-hackers@lists.postgresql.org; Wed, 01 Sep 2021 05:13:20 +0000 Received: from hrk.local (p2388012-ipbf1027funabasi.chiba.ocn.ne.jp [118.6.6.12]) by oss.nttdata.com (Postfix) with ESMTPSA id 330FB60A14; Wed, 1 Sep 2021 14:13:14 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.3 at oss.nttdata.com Subject: Re: Allow escape in application_name (was: [postgres_fdw] add local pid to fallback_application_name) To: "kuroda.hayato@fujitsu.com" Cc: "'pgsql-hackers@lists.postgresql.org'" , 'Tom Lane' References: From: Fujii Masao Message-ID: <8f985ba0-2e79-ab67-4fa4-d35024188047@oss.nttdata.com> Date: Wed, 1 Sep 2021 14:13:13 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-2022-jp; format=flowed; delsp=yes Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021/08/31 16:11, kuroda.hayato@fujitsu.com wrote: > Dear Fujii-san, > > I attached new version, that almost all codes > moved from libpq to postgres_fdw. Thanks for updating the patch! Can we split the patch into two as follows? If so, we can review and commit them one by one. #1. Add application_name GUC into postgres_fdw #2. Allow to specify special escape characters in application_name that postgres_fdw uses. > > 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. +1 > > 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. OK. > > Which version do you like? For now I've not found real use case that implementing the feature in libpq would introduce. So IMO postgres_fdw version is better. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION