Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGMbN-002WkX-8P for pgsql-bugs@arkaria.postgresql.org; Wed, 27 Nov 2024 18:17:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tGMbL-00008V-P3 for pgsql-bugs@arkaria.postgresql.org; Wed, 27 Nov 2024 18:17:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGMbL-00008N-FH for pgsql-bugs@lists.postgresql.org; Wed, 27 Nov 2024 18:17:23 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGMbJ-004Mpe-2E for pgsql-bugs@lists.postgresql.org; Wed, 27 Nov 2024 18:17:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4ARIHIGD1896107; Wed, 27 Nov 2024 13:17:18 -0500 From: Tom Lane To: Bertrand Drouvot cc: Nathan Bossart , Bruce Momjian , adam@labkey.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18711: Attempting a connection with a database name longer than 63 characters now fails In-reply-to: References: <659706.1732303427@sss.pgh.pa.us> <665338.1732306066@sss.pgh.pa.us> <1865227.1732723416@sss.pgh.pa.us> Comments: In-reply-to Bertrand Drouvot message dated "Wed, 27 Nov 2024 18:03:43 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1896105.1732731438.1@sss.pgh.pa.us> Date: Wed, 27 Nov 2024 13:17:18 -0500 Message-ID: <1896106.1732731438@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bertrand Drouvot writes: > Indeed, reverting might be the way to go then (without waiting for more 17 > behavior reports). I have an idea that might salvage something from what we've just been doing. The biggest single problem with the old behavior, AIUI, was the possibility of sending back encoding-corrupt names in connection failure reports. How about something like: * Don't truncate the names on sight (so we keep 562bee0fc1). * Truncate the names at NAMEDATALEN-1 just before catalog lookup (this restores the old lookup behavior, solving the current report). * In lookup-failure messages, be sure to report the un-truncated name (avoiding the bad-encoding problem). * Copy the correctly-truncated names from the catalog to any persistent storage such as MyProcPort, so that those are used for all post-connection purposes. regards, tom lane