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 1sGUWp-00Di4x-9X for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Jun 2024 02:13:00 +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 1sGUWn-007Lkd-Hk for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Jun 2024 02:12:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sGUWn-007LkJ-7s for pgsql-hackers@lists.postgresql.org; Mon, 10 Jun 2024 02:12:58 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sGUWl-000rK1-Ru for pgsql-hackers@lists.postgresql.org; Mon, 10 Jun 2024 02:12:57 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 45A2CrYq620743; Sun, 9 Jun 2024 22:12:53 -0400 From: Tom Lane To: Nathan Bossart cc: jian he , PostgreSQL Hackers Subject: Re: CheckMyDatabase some error messages in two lines. In-reply-to: References: Comments: In-reply-to Nathan Bossart message dated "Sun, 09 Jun 2024 21:02:37 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <620741.1717985573.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 09 Jun 2024 22:12:53 -0400 Message-ID: <620742.1717985573@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nathan Bossart writes: > On Mon, Jun 10, 2024 at 08:00:00AM +0800, jian he wrote: >> - errdetail("The database was initialized with LC_COLLATE \"%s\", " >> - " which is not recognized by setlocale().", collate), >> + errdetail("The database was initialized with LC_COLLATE \"%s\", w= hich is not recognized by setlocale().", collate), > Both approaches produce the same message. With the existing code, the t= wo > string literals will be concatenated without newlines. It is probably > split into two lines to avoid a long line in the source code. No doubt. People have done it both ways in the past, but I think currently there's a weak consensus in favor of using one line for such messages even when it runs past 80 columns, mainly because that makes it easier to grep the source code for a message text. But: I don't see too much value in changing this particular instance, because the line break is in a place where it would not likely cause you to miss finding the line. You might grep for the first part of the string or the second part, but probably not for ", which is not". If the line break were in the middle of a phrase, there'd be more argument for collapsing it out. regards, tom lane