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: Nathan Bossart <nathandbossart@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, adam@labkey.com, pgsql-bugs@lists.postgresql.org
Date: 2024-11-21T07:27:22Z
Lists: pgsql-bugs
Attachments
Hi, On Wed, Nov 20, 2024 at 04:36:44PM -0600, Nathan Bossart wrote: > Here is a draft patch that seems to work with some simple tests. Thanks! While doing the review, I added comments (that also helped me understand the code). So please find attached, v2 which is v1 with added comments. The logic in v1 looks good to me. The comments are based on my understanding so could be wrong. + /* XXX: should we fix process title? */ Prior to 562bee0fc1, we would have seen the truncated name in the process title. Now, with the patch applied, we would see the non truncated name (even in the non multibyte case). So, if want to be at the same state as prior to 562bee0fc1, then yes we would need to fix the process title. But thinking about it, I think that's a good thing to see what the "initial" attempt was (specially as the code is much more complicated now), so there is pros showing the non truncated name too. I'm tempted to vote for "show the non truncated name" then. 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