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 1tDmhM-003AQw-ID for pgsql-bugs@arkaria.postgresql.org; Wed, 20 Nov 2024 15:32:56 +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 1tDmhL-006hDn-5W for pgsql-bugs@arkaria.postgresql.org; Wed, 20 Nov 2024 15:32:55 +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 1tDmhK-006hDf-TC for pgsql-bugs@lists.postgresql.org; Wed, 20 Nov 2024 15:32:54 +0000 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tDmhI-002wa0-OA for pgsql-bugs@lists.postgresql.org; Wed, 20 Nov 2024 15:32:54 +0000 Received: by mail-qt1-x82e.google.com with SMTP id d75a77b69052e-460c2418e37so42011061cf.0 for ; Wed, 20 Nov 2024 07:32:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732116771; x=1732721571; 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=o0ZZ4c+YY2qOXR04RdadLN4kRPrZ8XwBr+mlbDILB3U=; b=fDGEPzgNwcYnxlhakB/vb548ItBzMspXQH644QlUKZuerxyQm3u14O+uLWp4xWcZ2w 6DIsfoeuGGGpGgr7t3s39u0HjsVIa67IdJBkNH+3tF/zv1rbYLJknXfCSZr/i4ispJWp 4ZhFLfaJucp57su2MsSzr1Z3nJ13QjKqFWOj/AVt6ouxZrxv4pz5zDmzvk38x7GEZFdq hwdQfB/CEUxHFfPRf5X+weazEMdOgBeejOKcTMxO9tKQobP1WpDRfc06wkOG/eCdvUOP 5FU3HZ+QLtV1vcBPfE6KCX+CQmMxmx562naUL+P32iqPEAPtqlpwH5fHjUX5I8lvEDXC Z++A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732116771; x=1732721571; 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=o0ZZ4c+YY2qOXR04RdadLN4kRPrZ8XwBr+mlbDILB3U=; b=hMVK0Ud6MFocrB004k5+fZ8L1LPDnorAyVaoWBB3yRS8m0JCSwuLU0jeGRFWtc7x6l TUKjgIpS3iOtFvpVQ0mJlbOFE6Dr76ztGf51BoJ7c5OqvfScwShuQdTxF1pFwG8QgyUM Xx14qMC8dCpi3zs08hwqrD9nRIx0+jW6Y6urq45aeNTDybIdIWMaWwVDclgTC46Z6Ins OufzVs5VwFeD1YEFpYHikyjg7v/nf/lShY9qGDNlnVsVpSrWoc9HXD5NFV6C2VWmwv5f EbFP0kstp9+Qy8bdfe/seUU84KUx9h5ikMYNRnX9i6iE/uZmCoYSMVQs+JeiQgdF533R nJNw== X-Forwarded-Encrypted: i=1; AJvYcCUhJ/l34+rcLQ8eIq8SWNJBunohL6bX1UfnkGdL4C68fyOnSAFms6I+ySmdSkeMgXWKw3jlyzBEcoSj@lists.postgresql.org X-Gm-Message-State: AOJu0YzAr6p46WbcVM2g/a8UkDf4EJI+mWIm17EKoNnPXXFJMNMpoQ0v k+svjRiqXibRPg/KmynwjmpjVXguWUzNfY9uFYwaD1Wwa3IrgXtK X-Google-Smtp-Source: AGHT+IFoXE6/D94uj4f8sqB6oyk4zQoxkWgRZ3xiqV0L9vKT+hK95DutZZPNmuJ9Uqg2KCh5dxGOrQ== X-Received: by 2002:a05:622a:2cd:b0:462:ae89:4695 with SMTP id d75a77b69052e-464783a6dc0mr32835741cf.30.1732116770638; Wed, 20 Nov 2024 07:32:50 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-464685cee50sm11187671cf.30.2024.11.20.07.32.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2024 07:32:50 -0800 (PST) Date: Wed, 20 Nov 2024 09:32:47 -0600 From: Nathan Bossart To: Bertrand Drouvot Cc: Tom Lane , 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 Message-ID: References: <18711-7503ee3e449d2c47@postgresql.org> <3072825.1731866414@sss.pgh.pa.us> <3796535.1732044807@sss.pgh.pa.us> <3976665.1732057784@sss.pgh.pa.us> <149256.1732115451@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Nov 20, 2024 at 03:20:45PM +0000, Bertrand Drouvot wrote: > On Wed, Nov 20, 2024 at 10:10:51AM -0500, Tom Lane wrote: >> Bertrand Drouvot writes: >> > Could we rely on pg_encoding_max_length() instead of MAX_MULTIBYTE_CHAR_LEN? That >> > would then work for short characters too IIUC. >> >> No. We don't know which encoding it is. Even if you wanted to say >> "use the database encoding", we haven't identified the database yet. > > I had in mind to "fully scan" pg_database in GetDatabaseTuple(), get the datname > and encoding from FormData_pg_database and start from there the comparison > with the dbname passed as an argument to GetDatabaseTuple(). Thoughts? I was wondering if we could use the database encoding to disambiguate if we found multiple matches, but IIUC the identifier will be truncated using the encoding of the database from which it was created. But hopefully this is all rare enough in practice... -- nathan