pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: adam@labkey.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18711: Attempting a connection with a database name longer than 63 characters now fails
Date: Wed, 20 Nov 2024 09:32:47 -0600
Message-ID: <Zz4BH8z_Oby0gR5X@nathan> (raw)
In-Reply-To: <Zz3+TWanHHjBUErS@ip-10-97-1-34.eu-west-3.compute.internal>
References: <18711-7503ee3e449d2c47@postgresql.org>
	<3072825.1731866414@sss.pgh.pa.us>
	<Zzzdc1QLIuFoiTvE@nathan>
	<3796535.1732044807@sss.pgh.pa.us>
	<Zz0WPCEzx-mPvUxA@nathan>
	<3976665.1732057784@sss.pgh.pa.us>
	<Zz2bBxJP8uoy2UkT@ip-10-97-1-34.eu-west-3.compute.internal>
	<149256.1732115451@sss.pgh.pa.us>
	<Zz3+TWanHHjBUErS@ip-10-97-1-34.eu-west-3.compute.internal>

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 <bertranddrouvot.pg@gmail.com> 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





view thread (67+ messages)  latest in thread

Message-ID: <Zz4BH8z_Oby0gR5X@nathan>
Permalink:  ../Zz4BH8z_Oby0gR5X@nathan/
Also on:    postgresql.org/message-id/Zz4BH8z_Oby0gR5X@nathan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: nathandbossart@gmail.com, bertranddrouvot.pg@gmail.com, tgl@sss.pgh.pa.us, 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: <Zz4BH8z_Oby0gR5X@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox