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.96) (envelope-from ) id 1wRaGT-002UUI-2S for pgsql-hackers@arkaria.postgresql.org; Mon, 25 May 2026 18:43:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wRaGP-001nXC-1q for pgsql-hackers@arkaria.postgresql.org; Mon, 25 May 2026 18:42: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.96) (envelope-from ) id 1wRaGP-001nX4-0v for pgsql-hackers@lists.postgresql.org; Mon, 25 May 2026 18:42: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.98.2) (envelope-from ) id 1wRaGN-00000001OXK-3eD2 for pgsql-hackers@postgresql.org; Mon, 25 May 2026 18:42:57 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 64PIgrjq135170; Mon, 25 May 2026 14:42:53 -0400 From: Tom Lane To: Yushu Chen cc: pgsql-hackers@postgresql.org Subject: Re: [PATCH] Add regression test for mismatched ENCODING and LOCALE in CREATE DATABASE In-reply-to: References: Comments: In-reply-to Yushu Chen message dated "Sat, 23 May 2026 20:10:26 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <135168.1779734573.1@sss.pgh.pa.us> Date: Mon, 25 May 2026 14:42:53 -0400 Message-ID: <135169.1779734573@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Yushu Chen writes: > While reading the CREATE DATABASE documentation at > https://www.postgresql.org/docs/current/sql-createdatabase.html, I > noticed the following sentence: > "The specified locale and encoding settings must match, or an error > will be reported." > However, we do not currently have regression coverage for that failure case. The reason there is no test for that is that the spelling of locale names, and indeed the presence of any particular locale, is variable across platforms. Your proposed test case might work fine on your machine, but it will fail on a nontrivial fraction of our buildfarm (where "fail" means "produce some other error message than what the test is expecting"). As a recent example where I too was overoptimistic about this, see the sad history of my attempts to install coverage of NLS translation (8c498479d, 5b275a6e1, fe7ede45f, 7db6809ce, 84a3778c7, 462e24765). We could perhaps install the test with multiple variant files to accept the cases we see in practice. But that would be a pain in the rear for maintenance, and you have to wonder what it'd actually be proving. regards, tom lane