Re: BUG #18711: Attempting a connection with a database name longer than 63 characters now fails
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Nathan Bossart <nathandbossart@gmail.com>, adam@labkey.com, pgsql-bugs@lists.postgresql.org
Date: 2024-11-20T15:20:45Z
Lists: pgsql-bugs
Hi, 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? Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com
Commits
-
Revert "Don't truncate database and user names in startup packets."
- d09fbf645ece 17.3 landed
- a0ff56e2d3ff 18.0 landed
-
Don't truncate database and user names in startup packets.
- 562bee0fc13d 17.0 cited
-
Truncate incoming username and database name to NAMEDATALEN-1 characters
- d18c1d1f5102 7.1.1 cited