On Fri, 2024-04-05 at 11:22 +1300, Thomas Munro wrote:
> Hi,
> 
> +command_ok(
> +       [
> +               'initdb', '--no-sync',
> +               '--locale-provider=builtin', '-E UTF-8',
> +               '--builtin-locale=C.UTF-8', "$tempdir/data8"
> +       ],
> +       'locale provider builtin with -E UTF-8 --builtin-
> locale=C.UTF-8');

...

>   LC_COLLATE:  en_US
>   LC_CTYPE:    en_US
>   LC_MESSAGES: C
>   LC_MONETARY: en_US
>   LC_NUMERIC:  en_US
>   LC_TIME:     en_US
> initdb: error: encoding mismatch
> initdb: detail: The encoding you selected (UTF8) and the encoding
> that
> the selected locale uses (LATIN1) do not match.

Thank you for the report.

I fixed it in e2a2357671 by forcing the environment locale to C which
is compatible with any encoding. The test still forces the encoding to
UTF-8 and the collation to the builtin C.UTF-8.

In passing, I noticed some unrelated regression test failures when I
set LANG=tr_TR: tsearch, tsdict, json, and jsonb. There's an additional
failure in the updatable_views test when LANG=tr_TR.utf8. I haven't
looked into the details yet.

Regards,
        Jeff Davis

From a7bf58f27bcd60bf79c097c7f462fa183264e9cd Mon Sep 17 00:00:00 2001
From: Jeff Davis <j...@j-davis.com>
Date: Thu, 4 Apr 2024 15:55:03 -0700
Subject: [PATCH v1] Fix test failure in 001_initdb.pl.

Reported-by: Thomas Munro
Discussion: https://postgr.es/m/CA+hUKGK-ZqV1njkG_=xcCqXh2fcMkz85FTMnhS2opm4ZerH=x...@mail.gmail.com
---
 src/bin/initdb/t/001_initdb.pl | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/bin/initdb/t/001_initdb.pl b/src/bin/initdb/t/001_initdb.pl
index c63d3206d9..b31dad2464 100644
--- a/src/bin/initdb/t/001_initdb.pl
+++ b/src/bin/initdb/t/001_initdb.pl
@@ -200,6 +200,7 @@ command_ok(
 	[
 		'initdb', '--no-sync',
 		'--locale-provider=builtin', '-E UTF-8',
+		'--lc-collate=C', '--lc-ctype=C',
 		'--builtin-locale=C.UTF-8', "$tempdir/data8"
 	],
 	'locale provider builtin with -E UTF-8 --builtin-locale=C.UTF-8');
@@ -208,6 +209,7 @@ command_fails(
 	[
 		'initdb', '--no-sync',
 		'--locale-provider=builtin', '-E SQL_ASCII',
+		'--lc-collate=C', '--lc-ctype=C',
 		'--builtin-locale=C.UTF-8', "$tempdir/data9"
 	],
 	'locale provider builtin with --builtin-locale=C.UTF-8 fails for SQL_ASCII'
-- 
2.34.1

Reply via email to