From: Jeff Davis <pgsql@j-davis.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: CREATE DATABASE: make LOCALE apply to all collation providers.
Date: Fri, 16 Jun 2023 17:09:28 -0700
Message-ID: <2f4ec2a4e20966474aabce0035ddf939af47fffc.camel@j-davis.com> (raw)
In-Reply-To: <2458565.1686953169@sss.pgh.pa.us>
References: <E1qADSG-0026fm-Gd@gemulon.postgresql.org>
<770040bf2ca4c247b2c88837a3cb00d2798cdde6.camel@j-davis.com>
<2458565.1686953169@sss.pgh.pa.us>
On Fri, 2023-06-16 at 18:06 -0400, Tom Lane wrote:
> You do not get to define that. The reason we have buildfarm members
> running tests this way is exactly to flush out tests that are unduly
> collation-sensitive. They will break in the field too.
It looks like the actual problem is that, when pg_regress creates the
database in --no-locale mode, it passes LC_COLLATE='C' and
LC_CTYPE='C', instead of just LOCALE='C'.
Before my commit, the two were equivalent so it didn't matter, but
afterwards it created an inconsistency that left daticulocale as cs-CZ.
Patch attached.
Regards,
Jeff Davis
Attachments:v1-0001-pg_regress-for-no-locale-use-LOCALE-C.patch (text/x-patch, 1.4K)download | inline diff:
From 09cdcc04fe79ca9df80d1f499701bf34902b703f Mon Sep 17 00:00:00 2001
From: Jeff Davis <jeff@j-davis.com>
Date: Fri, 16 Jun 2023 16:46:41 -0700
Subject: [PATCH v1] pg_regress: for --no-locale, use LOCALE='C'.
Instead of specifying LC_COLLATE='C' and LC_CTYPE='C', specify
LOCALE='C' which will also affect ICU. This makes pg_regress
consistent with recent changes to initdb in commit a14e75eb0b6.
Fixes buildfarm failure.
Discussion: https://postgr.es/m/2458565.1686953169@sss.pgh.pa.us
---
src/test/regress/pg_regress.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.cindex a546fc3d34..60d34a40b2 100644--- a/src/test/regress/pg_regress.c+++ b/src/test/regress/pg_regress.c@@ -1972,10 +1972,10 @@ create_database(const char *dbname)
*/
if (encoding)
psql_add_command(buf, "CREATE DATABASE \"%s\" TEMPLATE=template0 ENCODING='%s'%s", dbname, encoding,
- (nolocale) ? " LC_COLLATE='C' LC_CTYPE='C'" : "");+ (nolocale) ? " LOCALE='C'" : "");
else
psql_add_command(buf, "CREATE DATABASE \"%s\" TEMPLATE=template0%s", dbname,
- (nolocale) ? " LC_COLLATE='C' LC_CTYPE='C'" : "");+ (nolocale) ? " LOCALE='C'" : "");
psql_add_command(buf,
"ALTER DATABASE \"%s\" SET lc_messages TO 'C';"
"ALTER DATABASE \"%s\" SET lc_monetary TO 'C';"
--
2.34.1
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: pgsql@j-davis.com, tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: CREATE DATABASE: make LOCALE apply to all collation providers.
In-Reply-To: <2f4ec2a4e20966474aabce0035ddf939af47fffc.camel@j-davis.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox