diff options
author | Jeff Davis <jdavis@postgresql.org> | 2023-12-29 11:26:10 -0800 |
---|---|---|
committer | Jeff Davis <jdavis@postgresql.org> | 2023-12-29 11:26:10 -0800 |
commit | 2c321ceaa904eb2722050abd35bf4eaea434c8b5 (patch) | |
tree | 3bcdf495b659cfd51c783af48f2db5b6c26340a3 /src | |
parent | c5385929593dd8499cfb5d85ac322e8ee1819fd4 (diff) | |
download | postgresql-2c321ceaa904eb2722050abd35bf4eaea434c8b5.tar.gz postgresql-2c321ceaa904eb2722050abd35bf4eaea434c8b5.zip |
Fix collate.windows.win1252 test.
Do not rely on the OS recognizing a particular locale; find the right
locale by querying the "en_US" collation.
Author: Alexander Lakhin
Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/ae73f6f5-8221-c112-4640-5cda812a69de@gmail.com
Diffstat (limited to 'src')
-rw-r--r-- | src/test/regress/expected/collate.windows.win1252.out | 8 | ||||
-rw-r--r-- | src/test/regress/sql/collate.windows.win1252.sql | 9 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/test/regress/expected/collate.windows.win1252.out b/src/test/regress/expected/collate.windows.win1252.out index b7b93959de9..d99ba22431d 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.sql index 353d769a5bd..c7d6c97db16 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); |