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 1tELg3-006r7O-PQ for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Nov 2024 04:53:55 +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 1tELg2-005Dk9-FL for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Nov 2024 04:53:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tELg2-005Djz-6w for pgsql-bugs@lists.postgresql.org; Fri, 22 Nov 2024 04:53:54 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tELfz-003AG3-PW for pgsql-bugs@lists.postgresql.org; Fri, 22 Nov 2024 04:53:52 +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 4AM4rnvu509657; Thu, 21 Nov 2024 23:53:49 -0500 From: Tom Lane To: John Naylor cc: Bertrand Drouvot , Nathan Bossart , 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: <3976665.1732057784@sss.pgh.pa.us> <75265.1732076593@sss.pgh.pa.us> <154104.1732118090@sss.pgh.pa.us> <158506.1732120196@sss.pgh.pa.us> Comments: In-reply-to John Naylor message dated "Fri, 22 Nov 2024 11:39:15 +0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <509655.1732251229.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 21 Nov 2024 23:53:49 -0500 Message-ID: <509656.1732251229@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk John Naylor writes: > On Thu, Nov 21, 2024 at 2:27=E2=80=AFPM Bertrand Drouvot > wrote: > + * If the original name is too long and we see two consecutive bytes > + * with their high bits set at the truncation point, we might have > + * truncated in the middle of a multibyte character. In multibyte > + * encodings, every byte of a multibyte character has its high bit > + * set. > Counterexample: Shift JIS -- I don't think we can short-circuit the full= check. Shift JIS is not an allowed server-side encoding, for precisely that reason. This whole proposal is based on the assumption that the string we need to match in pg_database is valid in some server-side encoding. regards, tom lane