Reduce icu_validation_level default to WARNING.
authorJeff Davis <[email protected]>
Wed, 17 May 2023 20:18:40 +0000 (13:18 -0700)
committerJeff Davis <[email protected]>
Wed, 17 May 2023 20:18:40 +0000 (13:18 -0700)
Discussion: https://postgr.es/m/daa9f060aa2349ebc84444515efece49e7b32c5d[email protected]

doc/src/sgml/config.sgml
src/backend/utils/adt/pg_locale.c
src/backend/utils/misc/guc_tables.c
src/backend/utils/misc/postgresql.conf.sample
src/test/regress/expected/collate.icu.utf8.out
src/test/regress/sql/collate.icu.utf8.sql

index 2073bafa1f1b5e35de3c2c0458cc13bb6517143d..18ce06729b75142ee96472068cd0225d6d3ef673 100644 (file)
@@ -9841,7 +9841,7 @@ SET XML OPTION { DOCUMENT | CONTENT };
        <para>
         If set to <literal>DISABLED</literal>, does not report validation
         problems at all. Otherwise reports problems at the given message
-        level. The default is <literal>ERROR</literal>.
+        level. The default is <literal>WARNING</literal>.
        </para>
       </listitem>
      </varlistentry>
index f0b6567da127e0686171e0b99f0801df03da672d..de678da6033693cd6dea37998feb83bb84a2304a 100644 (file)
@@ -96,7 +96,7 @@ char     *locale_monetary;
 char      *locale_numeric;
 char      *locale_time;
 
-int                    icu_validation_level = ERROR;
+int                    icu_validation_level = WARNING;
 
 /*
  * lc_time localization cache.
index 8abf9bb644677fda4370a59cea6c920e6b294405..844781a7f5d5bf34e46c7551d494fb6f88d3cb25 100644 (file)
@@ -4689,7 +4689,7 @@ struct config_enum ConfigureNamesEnum[] =
                 NULL
                },
                &icu_validation_level,
-               ERROR, icu_validation_level_options,
+               WARNING, icu_validation_level_options,
                NULL, NULL, NULL
        },
 
index 11a4cf6cfbb011c6d975bb56072257fffbea9463..c8018da04ad9afe6847e3074371ddce895e398c5 100644 (file)
 #lc_numeric = 'C'                      # locale for number formatting
 #lc_time = 'C'                         # locale for time formatting
 
-#icu_validation_level = ERROR          # report ICU locale validation
+#icu_validation_level = WARNING                # report ICU locale validation
                                        # errors at the given level
 
 # default configuration for text search
index b5a221b030052381aa76083767f33ba17d320c56..c658ee1404d2f2de8d862e8cb37b439105cef5b2 100644 (file)
@@ -1037,18 +1037,18 @@ $$;
 RESET client_min_messages;
 CREATE COLLATION test3 (provider = icu, lc_collate = 'en_US.utf8'); -- fail, needs "locale"
 ERROR:  parameter "locale" must be specified
+SET icu_validation_level = ERROR;
 CREATE COLLATION testx (provider = icu, locale = 'nonsense-nowhere'); -- fails
 ERROR:  ICU locale "nonsense-nowhere" has unknown language "nonsense"
 HINT:  To disable ICU locale validation, set parameter icu_validation_level to DISABLED.
 CREATE COLLATION testx (provider = icu, locale = '@colStrength=primary;nonsense=yes'); -- fails
 ERROR:  could not convert locale name "@colStrength=primary;nonsense=yes" to language tag: U_ILLEGAL_ARGUMENT_ERROR
-SET icu_validation_level = WARNING;
+RESET icu_validation_level;
 CREATE COLLATION testx (provider = icu, locale = '@colStrength=primary;nonsense=yes'); DROP COLLATION testx;
 WARNING:  could not convert locale name "@colStrength=primary;nonsense=yes" to language tag: U_ILLEGAL_ARGUMENT_ERROR
 CREATE COLLATION testx (provider = icu, locale = 'nonsense-nowhere'); DROP COLLATION testx;
 WARNING:  ICU locale "nonsense-nowhere" has unknown language "nonsense"
 HINT:  To disable ICU locale validation, set parameter icu_validation_level to DISABLED.
-RESET icu_validation_level;
 CREATE COLLATION test4 FROM nonsense;
 ERROR:  collation "nonsense" for encoding "UTF8" does not exist
 CREATE COLLATION test5 FROM test0;
index 85e26951b626323adf575372dcedf77f886a7702..7bd090128108dbf41ca160ea290ad153c44f9b2c 100644 (file)
@@ -376,12 +376,12 @@ $$;
 RESET client_min_messages;
 
 CREATE COLLATION test3 (provider = icu, lc_collate = 'en_US.utf8'); -- fail, needs "locale"
+SET icu_validation_level = ERROR;
 CREATE COLLATION testx (provider = icu, locale = 'nonsense-nowhere'); -- fails
 CREATE COLLATION testx (provider = icu, locale = '@colStrength=primary;nonsense=yes'); -- fails
-SET icu_validation_level = WARNING;
+RESET icu_validation_level;
 CREATE COLLATION testx (provider = icu, locale = '@colStrength=primary;nonsense=yes'); DROP COLLATION testx;
 CREATE COLLATION testx (provider = icu, locale = 'nonsense-nowhere'); DROP COLLATION testx;
-RESET icu_validation_level;
 
 CREATE COLLATION test4 FROM nonsense;
 CREATE COLLATION test5 FROM test0;