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