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

Lines changed: 7 additions & 1 deletion
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

Lines changed: 7 additions & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy