Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2c321ce

Browse files
committed
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
1 parent c538592 commit 2c321ce

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/test/regress/expected/collate.windows.win1252.out

+7-1
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,13 @@ drop type textrange_c;
992992
drop type textrange_en_us;
993993
-- nondeterministic collations
994994
-- (not supported with libc provider)
995-
CREATE COLLATION ctest_det (locale = 'en_US', deterministic = true);
995+
do $$
996+
BEGIN
997+
EXECUTE 'CREATE COLLATION ctest_det (locale = ' ||
998+
quote_literal((SELECT collcollate FROM pg_collation WHERE
999+
collname = 'en_US')) || ', deterministic = true);';
1000+
END
1001+
$$;
9961002
CREATE COLLATION ctest_nondet (locale = 'en_US', deterministic = false);
9971003
ERROR: nondeterministic collations not supported with this provider
9981004
-- cleanup

src/test/regress/sql/collate.windows.win1252.sql

+7-2
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,13 @@ drop type textrange_en_us;
400400

401401
-- nondeterministic collations
402402
-- (not supported with libc provider)
403-
404-
CREATE COLLATION ctest_det (locale = 'en_US', deterministic = true);
403+
do $$
404+
BEGIN
405+
EXECUTE 'CREATE COLLATION ctest_det (locale = ' ||
406+
quote_literal((SELECT collcollate FROM pg_collation WHERE
407+
collname = 'en_US')) || ', deterministic = true);';
408+
END
409+
$$;
405410
CREATE COLLATION ctest_nondet (locale = 'en_US', deterministic = false);
406411

407412

0 commit comments

Comments
 (0)