Re: BUG #18711: Attempting a connection with a database name longer than 63 characters now fails

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, adam(at)labkey(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18711: Attempting a connection with a database name longer than 63 characters now fails
Date: 2024-11-21 07:27:22
Message-ID: Zz7g2s0GSBelWmpg@ip-10-97-1-34.eu-west-3.compute.internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

Attachment Content-Type Size
v2-0001-attempt-multibyte-aware-truncation-of-database-na.patch text/x-diff 3.9 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2024-11-21 08:26:34 BUG #18718: Incorrect Twitter/X Logo Displayed on PostgreSQL Documentation Page
Previous Message Peter Eisentraut 2024-11-21 07:23:05 Re: Build failure with GCC 15 (defaults to -std=gnu23)