mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Use ICU by default at initdb time.
If the ICU locale is not specified, initialize the default collator and retrieve the locale name from that. Discussion: https://postgr.es/m/510d284759f6e943ce15096167760b2edcb2e700.camel@j-davis.com Reviewed-by: Peter Eisentraut
This commit is contained in:
@ -1,9 +1,16 @@
|
||||
/*
|
||||
* This test must be run in a database with UTF-8 encoding
|
||||
* and a Unicode-aware locale.
|
||||
*
|
||||
* Also disable this file for ICU, because the test for the the
|
||||
* Turkish dotted I is not correct for many ICU locales. citext always
|
||||
* uses the default collation, so it's not easy to restrict the test
|
||||
* to the "tr-TR-x-icu" collation where it will succeed.
|
||||
*/
|
||||
SELECT getdatabaseencoding() <> 'UTF8' OR
|
||||
current_setting('lc_ctype') = 'C'
|
||||
current_setting('lc_ctype') = 'C' OR
|
||||
(SELECT datlocprovider='i' FROM pg_database
|
||||
WHERE datname=current_database())
|
||||
AS skip_test \gset
|
||||
\if :skip_test
|
||||
\quit
|
||||
|
@ -1,9 +1,16 @@
|
||||
/*
|
||||
* This test must be run in a database with UTF-8 encoding
|
||||
* and a Unicode-aware locale.
|
||||
*
|
||||
* Also disable this file for ICU, because the test for the the
|
||||
* Turkish dotted I is not correct for many ICU locales. citext always
|
||||
* uses the default collation, so it's not easy to restrict the test
|
||||
* to the "tr-TR-x-icu" collation where it will succeed.
|
||||
*/
|
||||
SELECT getdatabaseencoding() <> 'UTF8' OR
|
||||
current_setting('lc_ctype') = 'C'
|
||||
current_setting('lc_ctype') = 'C' OR
|
||||
(SELECT datlocprovider='i' FROM pg_database
|
||||
WHERE datname=current_database())
|
||||
AS skip_test \gset
|
||||
\if :skip_test
|
||||
\quit
|
||||
|
@ -1,10 +1,17 @@
|
||||
/*
|
||||
* This test must be run in a database with UTF-8 encoding
|
||||
* and a Unicode-aware locale.
|
||||
*
|
||||
* Also disable this file for ICU, because the test for the the
|
||||
* Turkish dotted I is not correct for many ICU locales. citext always
|
||||
* uses the default collation, so it's not easy to restrict the test
|
||||
* to the "tr-TR-x-icu" collation where it will succeed.
|
||||
*/
|
||||
|
||||
SELECT getdatabaseencoding() <> 'UTF8' OR
|
||||
current_setting('lc_ctype') = 'C'
|
||||
current_setting('lc_ctype') = 'C' OR
|
||||
(SELECT datlocprovider='i' FROM pg_database
|
||||
WHERE datname=current_database())
|
||||
AS skip_test \gset
|
||||
\if :skip_test
|
||||
\quit
|
||||
|
@ -1,3 +1,12 @@
|
||||
-- unaccent is broken if the default collation is provided by ICU and
|
||||
-- LC_CTYPE=C
|
||||
SELECT current_setting('lc_ctype') = 'C' AND
|
||||
(SELECT datlocprovider='i' FROM pg_database
|
||||
WHERE datname=current_database())
|
||||
AS skip_test \gset
|
||||
\if :skip_test
|
||||
\quit
|
||||
\endif
|
||||
CREATE EXTENSION unaccent;
|
||||
-- must have a UTF8 database
|
||||
SELECT getdatabaseencoding();
|
||||
|
8
contrib/unaccent/expected/unaccent_1.out
Normal file
8
contrib/unaccent/expected/unaccent_1.out
Normal file
@ -0,0 +1,8 @@
|
||||
-- unaccent is broken if the default collation is provided by ICU and
|
||||
-- LC_CTYPE=C
|
||||
SELECT current_setting('lc_ctype') = 'C' AND
|
||||
(SELECT datlocprovider='i' FROM pg_database
|
||||
WHERE datname=current_database())
|
||||
AS skip_test \gset
|
||||
\if :skip_test
|
||||
\quit
|
@ -1,3 +1,14 @@
|
||||
|
||||
-- unaccent is broken if the default collation is provided by ICU and
|
||||
-- LC_CTYPE=C
|
||||
SELECT current_setting('lc_ctype') = 'C' AND
|
||||
(SELECT datlocprovider='i' FROM pg_database
|
||||
WHERE datname=current_database())
|
||||
AS skip_test \gset
|
||||
\if :skip_test
|
||||
\quit
|
||||
\endif
|
||||
|
||||
CREATE EXTENSION unaccent;
|
||||
|
||||
-- must have a UTF8 database
|
||||
|
Reference in New Issue
Block a user