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 1nD1zQ-0007WS-P8 for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Jan 2022 10:26:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nD1zP-0003m0-F0 for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Jan 2022 10:26:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nD1zP-0003lq-60 for pgsql-hackers@lists.postgresql.org; Thu, 27 Jan 2022 10:26:51 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nD1zM-0003a3-IP for pgsql-hackers@postgresql.org; Thu, 27 Jan 2022 10:26:50 +0000 Received: from [172.20.10.7] (sp49-98-213-103.msd.spmode.ne.jp [49.98.213.103]) by oss.nttdata.com (Postfix) with ESMTPSA id 540B5600B7; Thu, 27 Jan 2022 19:26:40 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.5 at oss.nttdata.com Message-ID: Date: Thu, 27 Jan 2022 19:26:39 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: Support escape sequence for cluster_name in postgres_fdw.application_name Content-Language: en-US To: Kyotaro Horiguchi Cc: pgsql-hackers@postgresql.org References: <1041dc9a-c976-049f-9f14-e7d94c29c4b2@oss.nttdata.com> <20220127.171042.1194024926941192601.horikyota.ntt@gmail.com> From: Fujii Masao In-Reply-To: <20220127.171042.1194024926941192601.horikyota.ntt@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022/01/27 17:10, Kyotaro Horiguchi wrote: > At Tue, 25 Jan 2022 16:02:39 +0900, Fujii Masao wrote in >> Hi, >> >> Commit 6e0cb3dec1 allowed postgres_fdw.application_name to include >> escape sequences %a (application name), %d (database name), %u (user >> name) and %p (pid). In addition to them, I'd like to support the >> escape sequence (e.g., %C) for cluster name there. This escape >> sequence is helpful to investigate where each remote transactions came >> from. Thought? >> >> Patch attached. > > I don't object to adding more meaningful replacements, but more escape > sequence makes me anxious about the increased easiness of exceeding > the size limit of application_name. If this is really an issue, it might be time to reconsider the size limit of application_name. If it's considered too short, the patch that enlarges it should be proposed separately. > Considering that it is used to > identify fdw-initinator server, we might need to add padding (or > rather truncating) option in the escape sequence syntax, then warn > about truncated application_names for safety. I failed to understand this. Could you tell me why we might need to add padding option here? > Is the reason for 'C' in upper-case to avoid possible conflict with > 'c' of log_line_prefix? Yes. > I'm not sure that preventive measure is worth > doing. Looking the escape-sequence spec alone, it seems to me rather > strange that an upper-case letter is used in spite of its lower-case > is not used yet. I have no strong opinion about using %C. If there is better character for the escape sequence, I'm happy to use it. So what character is more proper? %c? > Otherwise all looks fine to me except the lack of documentation. The patch updated postgres-fdw.sgml, but you imply there are other documents that the patch should update? Could you tell me where the patch should update? Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION