pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: adam@labkey.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18711: Attempting a connection with a database name longer than 63 characters now fails
Date: Wed, 27 Nov 2024 09:40:13 -0600
Message-ID: <Z0c9XVU6aTd8neRr@nathan> (raw)
In-Reply-To: <Z0Dmw1ryKH8bEkyo@nathan>
References: <Zz9OTyWAvATeeHev@nathan>
	<Zz9jfOkVmlYcYHSy@momjian.us>
	<Zz9pOi3pGF-DnJTp@nathan>
	<Zz92cka2VlBDsat3@momjian.us>
	<Zz94l3LHsML0V9eu@nathan>
	<Z0A2o+dS0MqDE2Fs@ip-10-97-1-34.eu-west-3.compute.internal>
	<659706.1732303427@sss.pgh.pa.us>
	<Z0DjJbJV4ZWkLuQd@nathan>
	<665338.1732306066@sss.pgh.pa.us>
	<Z0Dmw1ryKH8bEkyo@nathan>

On Fri, Nov 22, 2024 at 02:17:07PM -0600, Nathan Bossart wrote:
> On Fri, Nov 22, 2024 at 03:07:46PM -0500, Tom Lane wrote:
>> Nathan Bossart <nathandbossart@gmail.com> writes:
>>> I think we'll also want to do something about MyProcPort->database_name
>> 
>> Huh, isn't that getting filled from InitPostgres's out_dbname?
> 
> I think ProcessStartupPacket() sets it.  That's called by
> BackendInitialize(), which is called before PostgresMain() (which is what
> ultimately calls InitPostgres()).  The truncation used to happen within
> ProcessStartupPacket(), and it updated MyProcPort directly.

Here's an attempt at dealing with this problem.  I've just taught
PostgresMain() to use out_dbname to update MyProcPort->database_name and
the process title as needed.  Of course, we still need to handle role
names, too...

That being said, I'm growing quite uneasy about the size of this hack, and
I'm wondering if it would be better to leave it alone (perhaps with an
update to the release notes) or just revert commit 562bee0 until we have a
better way of dealing with multibyte characters in identifiers (e.g.,
tracking their encoding).  I suspect there are similar problems in other
places (e.g., pg_dumpall).

-- 
nathan

Attachments:

  v8-0001-fix-database-name-truncation.patch (text/plain, 0B) download

view thread (67+ messages)  latest in thread

Message-ID: <Z0c9XVU6aTd8neRr@nathan>
Permalink:  ../Z0c9XVU6aTd8neRr@nathan/
Also on:    postgresql.org/message-id/Z0c9XVU6aTd8neRr@nathan

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: nathandbossart@gmail.com, tgl@sss.pgh.pa.us, bertranddrouvot.pg@gmail.com, bruce@momjian.us, adam@labkey.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18711: Attempting a connection with a database name longer than 63 characters now fails
  In-Reply-To: <Z0c9XVU6aTd8neRr@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox