Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxdik-0008Uq-MK for pgsql-committers@arkaria.postgresql.org; Thu, 07 Jan 2021 22:25:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kxdii-0002RV-N8 for pgsql-committers@arkaria.postgresql.org; Thu, 07 Jan 2021 22:25:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxdii-0002RO-Hi for pgsql-committers@lists.postgresql.org; Thu, 07 Jan 2021 22:25:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxdig-0006TQ-9x for pgsql-committers@lists.postgresql.org; Thu, 07 Jan 2021 22:25:27 +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 107MPO50231374; Thu, 7 Jan 2021 17:25:24 -0500 From: Tom Lane To: Michael Paquier cc: Robert Haas , pgsql-committers Subject: Re: pgsql: createdb: Fix quoting of --encoding, --lc-ctype and --lc-collate In-reply-to: <20200227130127.GE403330@paquier.xyz> References: <20200227051112.GA280980@paquier.xyz> <20200227130127.GE403330@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Thu, 27 Feb 2020 22:01:27 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <231372.1610058324.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 07 Jan 2021 17:25:24 -0500 Message-ID: <231373.1610058324@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > On Thu, Feb 27, 2020 at 02:11:12PM +0900, Michael Paquier wrote: >> The best thing I can think of is just to remove the test case for >> --lc-ctype. > So, thinking about nothing better, I have just removed this test. I just tried to run check-world on an OpenBSD 6.8 installation, and look what I got: t/020_createdb.pl ......... 14/19 = # Failed test 'createdb with incorrect --lc-collate stderr /(?^s:^create= db: error: database creation failed: ERROR: invalid locale name)/' # at t/020_createdb.pl line 35. # 'createdb: error: database creation failed: ERROR: ne= w collation (foo'; SELECT '1) is incompatible with the collation of the te= mplate database (C) # HINT: Use the same collation as in the template database, or use templa= te0 as template. # ' # doesn't match '(?^s:^createdb: error: database creation failed: ERRO= R: invalid locale name)' # Looks like you failed 1 test of 19. t/020_createdb.pl ......... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/19 subtests = So on this machine, setlocale() is lax about LC_COLLATE values as well as (presumably) LC_CTYPE. Question then becomes why we did not notice for nearly a year. It looks like, of the not-very-many OpenBSD machines in the buildfarm, the only one running the TAP tests is curculio, and that's running OpenBSD 5.9 which is quite old. Comparing their setlocale(3) man pages for different versions, it looks like the current verbiage appeared in 6.3; older versions have text similar to other BSDen. So it looks like they actually ripped out a lot of locale functionality in 6.3. It seems like (1) we need to drop the --lc-collate version of this test too, or else adjust both tests to accept the error we get on OpenBSD as well as the normal error; (2) somebody really ought to crank up a modern OpenBSD critter that's running the TAP tests. regards, tom lane