Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGK9N-002FIR-IQ for pgsql-bugs@arkaria.postgresql.org; Wed, 27 Nov 2024 15:40:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tGK9M-00GA5e-8V for pgsql-bugs@arkaria.postgresql.org; Wed, 27 Nov 2024 15:40:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGK9L-00GA4m-Rn for pgsql-bugs@lists.postgresql.org; Wed, 27 Nov 2024 15:40:19 +0000 Received: from mail-yw1-x112d.google.com ([2607:f8b0:4864:20::112d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tGK9I-004BCt-Mz for pgsql-bugs@lists.postgresql.org; Wed, 27 Nov 2024 15:40:18 +0000 Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-6eeac3535baso69494547b3.1 for ; Wed, 27 Nov 2024 07:40:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732722016; x=1733326816; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=dFJ1WZjvv416356bSyjAKLNOcIlln8TkkcNhHBy/u6k=; b=ccAcUVEArqHX3gS1ckdTlpCuzq8glTjABeSdJFFm4h6SefO++aXlqhjuXIq0sZTW+J 0j+lqcDPvw/q47iIDPChR5PxRVKvZRA9p+viWATCvflpNj+Uq9wuKOGHYBjDb8QN4wEI AFw+4HlH0DWJcw/HIPt3VDrBD/mmH+cDVQS7ISj2sARofSxKUzJnFrhNJ42kW/5goAkm KxLp+JAYfpEwNW15sDo8DMSmySL/SJPGBPLQVCitDh70E0r/hew/xIAma45uLS+GWlbC WBRlHNsEKuoQ+7GRuwdI/t0v+626nifYGZl1eA5Ikf5qzLi5Oy8qwrV8KtG758I4aE6G KFlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732722016; x=1733326816; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dFJ1WZjvv416356bSyjAKLNOcIlln8TkkcNhHBy/u6k=; b=rCaI3/azhIkcQZFBI5UipouxYdlcu3Xf4NlNRUGIsYFzkE+vFLLsRTHvJGmcccSbR1 4N0lL5NwMtQr3nSVsHC5UzNIRWsjX0noR2su+Fz93yYxbv2KJGmnD0vlSiMZuEGVXngE +Zhg7rLA0CTF4ZLV4YQHPb+QAwKHaWoxuHc7dRuDArdI5dI5qOqorfs5++/9NWTErkRg keAi1FMAkVOYsjPrPrkTewdTtNoJPl93jdxmqdjcYyzvr9zkJ/ooEANr1RhsZ8VbzmwZ UcdPxKhGmVEueOpkY2eJK+pxELyhJsqTCbha+fb/4ouIdTkSkTn4LK2pKdQ1KYeRSEeS 0CpA== X-Forwarded-Encrypted: i=1; AJvYcCUhsb2U0Lf/2h61GF9ULD30gc8BcqUtZCEuKaq0/jm+NVcRp8Ch4U8F5y6fVqFLbcprQr5qYSU1vqOs@lists.postgresql.org X-Gm-Message-State: AOJu0Yw0QDcdVaI9FR6OzzoZ3ThCHliywfxtiGsS8J3fKsGiP6NNT8s9 MjpA8HX0OZVCI/rknLxPsxdRmu+eGliK5nxCRgbzT7NMdtfLNZyB X-Gm-Gg: ASbGncu398Rj2a/j57jQNZAf+6L9rUItf84g09w/xup2TArofAK0250EsnpHnaFZCTw pCnKJDkuSlhyT/MyUofnPy42qOiRyYrR7+hM/l5C6kvEfsl08hGtap75ag822fKm9CHoYY4tou4 fAvU3K1Z5DO2JgObPQdSd03sClbaBBu7QRXGRTt7x+FF9TE22EcG58sE0uxmzA7qoS0MlPr94al w6FednKd+F9AeTioIP4Amu/noO9viYSvtoO2Z2PR++uLj4/HgMvWGSemrEzfusM6Ji3yqKFgz2P yOYmVVKcJ5wHHo2HP1twVdYP1y1KCf99yylzpycN X-Google-Smtp-Source: AGHT+IH7xTnid81nyTUpylRvf1IeRjvJyQNlcrADxqjkcF74Sj0IgVi1xrs9jR3IQu1+yI3R9CITFw== X-Received: by 2002:a05:690c:6ac5:b0:6ea:8556:1cd6 with SMTP id 00721157ae682-6ef37272b9emr40808727b3.30.1732722015805; Wed, 27 Nov 2024 07:40:15 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6d451a831edsm67202276d6.10.2024.11.27.07.40.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2024 07:40:15 -0800 (PST) Date: Wed, 27 Nov 2024 09:40:13 -0600 From: Nathan Bossart To: Tom Lane Cc: Bertrand Drouvot , Bruce Momjian , 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 Message-ID: References: <659706.1732303427@sss.pgh.pa.us> <665338.1732306066@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="c7nARe+9MIG3DUN3" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --c7nARe+9MIG3DUN3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 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 --c7nARe+9MIG3DUN3 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="v8-0001-fix-database-name-truncation.patch"