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 1tDTH1-000xYC-A3 for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Nov 2024 18:48:27 +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 1tDTGz-00G1df-US for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Nov 2024 18:48:25 +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 1tDTGz-00G1dX-L4 for pgsql-bugs@lists.postgresql.org; Tue, 19 Nov 2024 18:48:25 +0000 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tDTGx-002nIJ-4y for pgsql-bugs@lists.postgresql.org; Tue, 19 Nov 2024 18:48:25 +0000 Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-7b14df8f821so339109385a.2 for ; Tue, 19 Nov 2024 10:48:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732042101; x=1732646901; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=wjIo8pWmslf2JqAW9Ghf293wKUUBOCx6DOMIa7tdn/U=; b=WZSdjym4Zbc196UHFiruJSOxRK+k4F67iOnlT2SALQURrRQ28YxyrQeLtdt1K6u1dZ 3jl5cR4qwCWPi1taRG8amjd/+Tj+XOMNkTMgOV0l+WO6QIiV/CPuJnzgrLeOJ168Z/VA tu9ef2t5d47u4SsedqgHom2RYdJCjp9OrVmHLy7cW2bFWQaXrygSGtAvqi+HN0GAYNOW 96w4BOUkilX2bp78sw6Zn6xgaopSenKKHvW5AahU1n9o3kmZ7WQPRSx/CIxrBz+7GW9u Yc6Sku9TYAGBl1YiIg5lkSq1kwNPO4gPO3z3I8TW/pEHx7B5a3WaS8E3abOhFMMeFHWw Hyww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732042101; x=1732646901; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=wjIo8pWmslf2JqAW9Ghf293wKUUBOCx6DOMIa7tdn/U=; b=Qep5HKqsoNMIBvLF8Ddf6hm3Rf04C51kZPKwiJ3+ho7zeZz+gHW0zw7UeVfMHJefIP UbMKgn8KS+dn4s8zVivbUVp3q5YjFn6+eKSrzgh2Jz5oV0pjcgCCOtJX2mMBS42donY7 8XD2srwC8jVHPwURiK+i7KlWw4PxJxC2bjscwTqmP1LeDsAIO20LcMz0pZ30G+qQ6DsA wK9sU9lQI1g3s8tiDnbzmf7CgSdBnc1xzmJcbkafst8pcQJOrir0bUyvGa8xkUxzH9Vw Skum3VCuX25kBvYuY61kLuUzqiXKx7T5LpLagNeYfs7Eog702zsmnM4sRSe6cSpYn2yi oHHg== X-Forwarded-Encrypted: i=1; AJvYcCVhDgyvAETHI4iehFN8oGUg5NQSbp1F0O9G5J8v7oComHREpnILw2pzRwubkdLMIA9HZELXzYuiV0Xq@lists.postgresql.org X-Gm-Message-State: AOJu0YwIB0U69PpF80URNzOjZ9jPbH4q76HGUrEyVCf/RnE9fmYT/pJ0 0DurRLFcy110UEWRaFlNUcYCLbfviozada8JhlFAhAHxSdK45hV7 X-Google-Smtp-Source: AGHT+IG/bhliLIiw8+yudyt6CMNl+zqOa+gYLBUBwGjCRrxirw3DDHXvdPbQ117GPeWUAp2lkO6uJw== X-Received: by 2002:a05:620a:608c:b0:7ae:5c67:e1b8 with SMTP id af79cd13be357-7b42eddcbdamr4952485a.20.1732042101649; Tue, 19 Nov 2024 10:48:21 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b37a89637esm119744485a.82.2024.11.19.10.48.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 10:48:21 -0800 (PST) Date: Tue, 19 Nov 2024 12:48:19 -0600 From: Nathan Bossart To: Tom Lane Cc: adam@labkey.com, Bertrand Drouvot , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18711: Attempting a connection with a database name longer than 63 characters now fails Message-ID: References: <18711-7503ee3e449d2c47@postgresql.org> <3072825.1731866414@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3072825.1731866414@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Nov 17, 2024 at 01:00:14PM -0500, Tom Lane wrote: > As said, the difficulty is that we don't know what encoding the > incoming name is meant to be in, and with multibyte encodings that > matters. The name actually stored in the catalog might be less > than 63 bytes long if it was truncated in a multibyte-aware way, > so that the former behavior of blindly truncating at 63 bytes > can still yield unexpected no-such-database results. > > I can imagine still performing the truncation if the incoming > name is all-ASCII, but that seems like a hack. The world isn't > nearly as ASCII-centric as it was in 2001. I wonder if we should consider removing the identifier truncation altogether. Granted, it mostly works (or at least did before v17), but I'm not sure we'd make the same decision today if we were starting from scratch. IMHO it'd be better to ERROR so that users are forced to produce legal identifiers. That being said, I realize this behavior has been present for over a quarter century now [0] [1] [2], and folks are unlikely to be happy with even more breakage. [0] https://postgr.es/c/d15c37c [1] https://postgr.es/c/0672a3c [2] https://postgr.es/c/49581f9 -- nathan