Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j7BSa-00011N-0g for pgsql-committers@arkaria.postgresql.org; Thu, 27 Feb 2020 05:11:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j7BSX-0002he-1I for pgsql-committers@arkaria.postgresql.org; Thu, 27 Feb 2020 05:11:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j7BSV-0002hX-8C for pgsql-committers@lists.postgresql.org; Thu, 27 Feb 2020 05:11:40 +0000 Received: from [66.111.4.25] (helo=out1-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j7BSL-0008Db-MN for pgsql-committers@lists.postgresql.org; Thu, 27 Feb 2020 05:11:38 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 88D4F21EAE; Thu, 27 Feb 2020 00:11:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 27 Feb 2020 00:11:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=5xUhGcRpmFBmmJ7HvTeXzyISSti 3nM2SCT3Lk1A1VO0=; b=F6qbT1qM4c6vZuBy98wjJKQxphEgPr8y0U/nODe59FR 6qr5WWRbxCwwE/XhcDkELN59eu8kdvu840WlgkDeXlIHg348ap7fDBeMrJSLN3oW Y4VE5Uu/lUPn89mQ5JNSnnmG1KCYiKQULn77D/RKYRMb7PvxTheFQI3TO+GAnPsu Q6vCvM+O3X3T2gM96TBOa+o62pYuuw+Qa9ywA+KW32nrIXr3t7Cy+RXjl33PqJRq aW2/vv4ZMq1d0/Hxk2x2QdQXuHLOKQXX6TNsSSzSxVcGGOQrR53InKSUKnKnc4Nu F43Pz4bq376/5eaDgur2CpZilklSkEE3qvuZnGwTVyw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=5xUhGc RpmFBmmJ7HvTeXzyISSti3nM2SCT3Lk1A1VO0=; b=VaWyj6Gj/QKdsCStwNX6tk PVchi91c/VZ8AW5Y/+mxuF8L77z64QEn+Ur5ZTEMMqGmgUyz9iwcPAZKsXtkfKsc yWeTvb1gGz7YZd02G5XzWJTxY3Bc37AB1jswMqicLRkAQvmBzx7mxk95Pt6+OKIc X7+1KIoE6DRPwWJI8xUjonRfvbI0XFJ3uuEEytQQr0suJC8+Ird7kGpic7MG1yzg x62v0t1PB6OZ6fEz1sxLFU83U/hlTzqj/nKg6G8bGbUovKiTiObNG6UCuDnS4JVP nWeSrU0CEYeeGRLoFRXdrLmLLdl5MyzIEwGNb52u+8NAtk6V2uZXZ1YxlpNoAVEg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrleehgdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdefhedmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuffhomhgrihhnpehophgvnhgsshgurdhorhhgnecukfhppedu udekrddvgedurddvgeelrddugeefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: from paquier.xyz (mp76f1f98f.ap.nuro.jp [118.241.249.143]) by mail.messagingengine.com (Postfix) with ESMTPA id EC7073060D1A; Thu, 27 Feb 2020 00:11:15 -0500 (EST) Date: Thu, 27 Feb 2020 14:11:12 +0900 From: Michael Paquier To: Robert Haas Cc: pgsql-committers Subject: Re: pgsql: createdb: Fix quoting of --encoding, --lc-ctype and --lc-collate Message-ID: <20200227051112.GA280980@paquier.xyz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fdj2RfSjLxBAspz7" Content-Disposition: inline In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.25 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 27, 2020 at 09:43:14AM +0530, Robert Haas wrote: > Buildfarm member curculio just failed with this complaint: Thanks, I missed this report. > # Failed test 'createdb with incorrect --lc-ctype stderr > /(?^s:^createdb: error: database creation failed: ERROR: invalid > locale name)/' > # at t/020_createdb.pl line 43. > # 'createdb: error: database creation failed: ERROR: > new LC_CTYPE (foo'; SELECT '1) is incompatible with the LC_CTYPE of > the template database (C) > # HINT: Use the same LC_CTYPE as in the template database, or use > template0 as template. Now that's interesting. The error I would have expected to find is =66rom createdb() so as we should actually bump on a failure for setlocale(LC_CTYPE). But this means that setlocale() with an incorrect value actually succeeded, and that the fallback became "C". Oh, actually, this behavior is mentioned here: https://man.openbsd.org/setlocale.3 The best thing I can think of is just to remove the test case for --lc-ctype. Now looking at the code of OpenBSD there could be an alternative: using a string longer than 256 characters if I read lib/libc/locale/setlocale.c correctly, but I'd rather not rely on that. Thoughts? -- Michael --fdj2RfSjLxBAspz7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl5XT3AACgkQnvQgOdby QH3PgA/7BgJzTTfwU5M8JvG9Os2lHcXbh8icNuSQ+EmWWHFJS2N5xF9sHy/a1jyk pgN2eKKc8TraKjHoVpmUbfkkG83MuJTwcTy/g6XjM6lsE5cd1nzs2tJ0fvXZoueh ACEqErAvCDbCz2I0vHtHtZ9nzrr1F3FctahuHxRC95v6I7h7ZlULOHQrniift0Gd LcoiTab6AaTCI1IgXnKbjK0oYuYWM6NyBypVvAVA8YJYQ9sMuDosabf+dw7zn1sc OXrbFwLRtDDa/jQvBqZ8UULvj1M0BMiKE/oEvraywg1+Fz0h678LUBpAN3Q2B6Fx Q5NRjo1vVzAckU4n1nKvkt0NQ9yTPcit8x38ixQ8Cz6QdvysxTWNyOBj8h4pN1Ts STvOEFmD4h63MjXjZVjpWrNbaIu9/Mp97H++c1jG5m8BEK4VMfho8FtTVCQ/jR24 cQ+JNMmADomv1eET5c9DKgvD+TePRG5x8mz2DvbzlpKXjqRO+gEhqWCwwEUf7qqP rtlByblnjxnbFTMMTVPBJ8sWYbVwiyzq6LRapICBXgSzm411PcHffGc/WeUENf+q u/tk4ViPrgOUMWHdxmjfFtV4G3L/u7EhIu6sqUbLBreR9fE7ZgGIL3W5IdLizele ybiTSeUQqvfQxVUqyeUMFClBCFo5e0Iu8v+473qZJwx3QRGSMvk= =Uk+h -----END PGP SIGNATURE----- --fdj2RfSjLxBAspz7--