Re: ProcessStartupPacket(): database_name and user_name truncation - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: ProcessStartupPacket(): database_name and user_name truncation
Date
Msg-id 20230621150402.GA789404@nathanxps13
Whole thread Raw
In response to Re: ProcessStartupPacket(): database_name and user_name truncation  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Jun 21, 2023 at 09:43:38AM -0400, Tom Lane wrote:
> Kyotaro Horiguchi <horikyota.ntt@gmail.com> writes:
>> IMHO, I'm not sure we should allow connections without the exact name
>> being provided. In that sense, I think we might want to consider
>> outright rejecting the estblishment of a connection when the given
>> database name doesn't fit the startup packet, since the database with
>> the exact given name cannot be found.
> 
> I think I agree.  I don't like the proposed patch at all, because it's
> making completely unsupportable assumptions about what encoding the
> names are given in.  Simply failing to match when a name is overlength
> sounds safer.

+1.  Even if these assumptions were supportable, IMHO it's probably not
worth the added complexity to keep the truncation consistent with CREATE
ROLE/DATABASE.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Matthias van de Meent
Date:
Subject: Re: bgwriter doesn't flush WAL stats
Next
From: Tomas Vondra
Date:
Subject: Re: Use of additional index columns in rows filtering