From: Alexander Lakhin <exclusion@gmail.com>
To: Jeff Davis <pgsql@j-davis.com>
To: Noah Misch <noah@leadboat.com>
To: Andres Freund <andres@anarazel.de>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: broken master regress tests
Date: Thu, 28 Dec 2023 22:00:00 +0300
Message-ID: <597af378-0d0f-0b24-4f82-a5af04863358@gmail.com> (raw)
In-Reply-To: <daa2d17d5544e0f75ea05b1024c9feec74b46c12.camel@j-davis.com>
References: <CA+hUKG+VkcevnqLmbZSD4C5hJ3=TQWgMP-th8LqsbNt0TqZfqw@mail.gmail.com>
<20230829155424.bem25upvaefkqqyy@alvherre.pgsql>
<20230912022358.d5ln25sglrntwaia@awork3.anarazel.de>
<0d47e5ecc037b3908149aad5f2a987793cf938bd.camel@j-davis.com>
<20231011005434.34oc4v4pv6ajqkss@awork3.anarazel.de>
<20231213025619.70.nmisch@google.com>
<97c9d15247c5919b444b2e217b4c886271be0ea5.camel@j-davis.com>
<c6571aac4c6da3e2f013fe74fcc95d6e052bf04c.camel@j-davis.com>
<ae73f6f5-8221-c112-4640-5cda812a69de@gmail.com>
<daa2d17d5544e0f75ea05b1024c9feec74b46c12.camel@j-davis.com>
28.12.2023 20:36, Jeff Davis wrote:
> We do want that test to run though, right?
Yes, I think so.
> I suspect that test line never worked reliably. The skip_test check at
> the top guarantees that the collation named "en_US" exists, but that
> doesn't mean that the OS understands the locale 'en_US'.
>
> Perhaps we can change that line to use a similar trick as what's used
> elsewhere in the file:
>
> do $$
> BEGIN
> EXECUTE 'CREATE COLLATION ctest_det (locale = ' ||
> quote_literal((SELECT collcollate FROM pg_collation WHERE
> collname = ''en_US'')) || ', deterministic = true);';
> END
> $$;
>
> The above may need some adjustment, but perhaps you can try it out?
Yes, this trick resolves the issue, it gives locale 'en-US' on that OS,
which works there. Please see the attached patch.
But looking at the result with the comment above that "do" block, I wonder
whether this successful CREATE COLLATION command is so important to perform
it that tricky way, if we want to demonstrate that nondeterministic
collations not supported.
So in case you decide just to remove this command, please see the second
patch.
Best regards,
Alexander
Attachments:download all (2 files, .tar.gz)fix-collate-windows-test-.patch (text/x-patch, 1.1K) downloaddiff --git a/src/test/regress/expected/collate.windows.win1252.out b/src/test/regress/expected/collate.windows.win1252.outindex b7b93959de..bb6297a113 100644--- a/src/test/regress/expected/collate.windows.win1252.out+++ b/src/test/regress/expected/collate.windows.win1252.out@@ -992,7 +992,6 @@ drop type textrange_c;
drop type textrange_en_us;
-- nondeterministic collations
-- (not supported with libc provider)
-CREATE COLLATION ctest_det (locale = 'en_US', deterministic = true);
CREATE COLLATION ctest_nondet (locale = 'en_US', deterministic = false);
ERROR: nondeterministic collations not supported with this provider
-- cleanup
diff --git a/src/test/regress/sql/collate.windows.win1252.sql b/src/test/regress/sql/collate.windows.win1252.sqlindex 353d769a5b..6246d89634 100644--- a/src/test/regress/sql/collate.windows.win1252.sql+++ b/src/test/regress/sql/collate.windows.win1252.sql@@ -400,8 +400,6 @@ drop type textrange_en_us;
-- nondeterministic collations
-- (not supported with libc provider)
--CREATE COLLATION ctest_det (locale = 'en_US', deterministic = true);
CREATE COLLATION ctest_nondet (locale = 'en_US', deterministic = false);
fix-collate-windows-test+.patch (text/x-patch, 1.6K) downloaddiff --git a/src/test/regress/expected/collate.windows.win1252.out b/src/test/regress/expected/collate.windows.win1252.outindex b7b93959de..97cbfc86de 100644--- a/src/test/regress/expected/collate.windows.win1252.out+++ b/src/test/regress/expected/collate.windows.win1252.out@@ -992,7 +992,13 @@ drop type textrange_c;
drop type textrange_en_us;
-- nondeterministic collations
-- (not supported with libc provider)
-CREATE COLLATION ctest_det (locale = 'en_US', deterministic = true);+do $$+BEGIN+ EXECUTE 'CREATE COLLATION ctest_det (locale = ' ||+ quote_literal((SELECT collcollate FROM pg_collation WHERE+ collname = 'en_US')) || ', deterministic = true);';+ END+$$;
CREATE COLLATION ctest_nondet (locale = 'en_US', deterministic = false);
ERROR: nondeterministic collations not supported with this provider
-- cleanup
diff --git a/src/test/regress/sql/collate.windows.win1252.sql b/src/test/regress/sql/collate.windows.win1252.sqlindex 353d769a5b..727d136f2f 100644--- a/src/test/regress/sql/collate.windows.win1252.sql+++ b/src/test/regress/sql/collate.windows.win1252.sql@@ -400,8 +400,13 @@ drop type textrange_en_us;
-- nondeterministic collations
-- (not supported with libc provider)
--CREATE COLLATION ctest_det (locale = 'en_US', deterministic = true);+do $$+BEGIN+ EXECUTE 'CREATE COLLATION ctest_det (locale = ' ||+ quote_literal((SELECT collcollate FROM pg_collation WHERE+ collname = 'en_US')) || ', deterministic = true);';+ END+$$;
CREATE COLLATION ctest_nondet (locale = 'en_US', deterministic = false);
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-hackers@postgresql.org
Cc: exclusion@gmail.com, pgsql@j-davis.com, noah@leadboat.com, andres@anarazel.de, alvherre@alvh.no-ip.org, thomas.munro@gmail.com, pavel.stehule@gmail.com, boekewurm+postgres@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: broken master regress tests
In-Reply-To: <597af378-0d0f-0b24-4f82-a5af04863358@gmail.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