#include "postgres.h"
#include <time.h>
#include "access/htup_details.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_database.h"
#include "common/hashfn.h"
#include "common/string.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "utils/builtins.h"
#include "utils/guc_hooks.h"
#include "utils/lsyscache.h"
#include "utils/memutils.h"
#include "utils/pg_locale.h"
#include "utils/relcache.h"
#include "utils/syscache.h"
#include "lib/simplehash.h"
Go to the source code of this file.
Definition at line 65 of file pg_locale.c.
Definition at line 56 of file pg_locale.c.
Definition at line 132 of file pg_locale.c.
Definition at line 133 of file pg_locale.c.
Definition at line 124 of file pg_locale.c.
Definition at line 129 of file pg_locale.c.
Definition at line 127 of file pg_locale.c.
Definition at line 126 of file pg_locale.c.
Definition at line 125 of file pg_locale.c.
Definition at line 123 of file pg_locale.c.
Definition at line 130 of file pg_locale.c.
Definition at line 131 of file pg_locale.c.
Definition at line 63 of file pg_locale.c.
Definition at line 402 of file pg_locale.c.
References newval, and pg_perm_setlocale().
Definition at line 351 of file pg_locale.c.
References CurrentLocaleConvValid.
Definition at line 1438 of file pg_locale.c.
References ereport, errcode(), errmsg(), ERROR, locale, and PG_UTF8.
Referenced by builtin_validate_locale(), and DefineCollation().
Definition at line 1462 of file pg_locale.c.
References builtin_locale_encoding(), encoding, ereport, errcode(), errmsg(), ERROR, locale, and pg_encoding_to_char.
Referenced by create_pg_locale_builtin(), createdb(), and DefineCollation().
Definition at line 695 of file pg_locale.c.
References _dosmaperr(), buf, cache_single_string(), CurrentLCTimeValid, DEBUG3, elog, encoding, ERROR, i, locale, locale_t, locale_time, localized_abbrev_days, localized_abbrev_months, localized_full_days, localized_full_months, MAX_L10N_DATA, pg_get_encoding_from_locale(), PG_SQL_ASCII, PG_UTF8, report_newlocale_failure(), and tm.
Referenced by DCH_from_char(), and DCH_to_char().
Definition at line 672 of file pg_locale.c.
References encoding, MemoryContextStrdup(), pfree(), pg_any_to_server(), and TopMemoryContext.
Referenced by cache_locale_time().
Definition at line 1406 of file pg_locale.c.
References locale.
Referenced by pattern_char_isalpha().
Definition at line 1417 of file pg_locale.c.
References locale.
Referenced by Generic_Text_IC_like().
Definition at line 268 of file pg_locale.c.
References elog, ereport, errcode(), errmsg(), locale, pfree(), pg_is_ascii(), pstrdup(), setlocale, and WARNING.
Referenced by check_locale_messages(), check_locale_monetary(), check_locale_numeric(), check_locale_time(), and createdb().
Definition at line 379 of file pg_locale.c.
References check_locale(), newval, PGC_S_DEFAULT, and source.
Definition at line 333 of file pg_locale.c.
References check_locale(), and newval.
Definition at line 345 of file pg_locale.c.
References check_locale(), and newval.
Definition at line 357 of file pg_locale.c.
References check_locale(), and newval.
Definition at line 1042 of file pg_locale.c.
References Assert(), pg_locale_struct::collate, pg_locale_struct::collate_is_c, collid, create_pg_locale_builtin(), create_pg_locale_icu(), create_pg_locale_libc(), pg_locale_struct::ctype, pg_locale_struct::ctype_is_c, elog, ereport, errdetail(), errhint(), errmsg(), ERROR, get_collation_actual_version(), get_namespace_name(), GETSTRUCT(), HeapTupleIsValid, pg_locale_struct::is_default, NameStr, ObjectIdGetDatum(), PGLOCALE_SUPPORT_ERROR, quote_qualified_identifier(), ReleaseSysCache(), SearchSysCache1(), SysCacheGetAttr(), SysCacheGetAttrNotNull(), TextDatumGetCString, and WARNING.
Referenced by pg_newlocale_from_collation().
Definition at line 205 of file pg_locale_builtin.c.
References pg_locale_struct::builtin, builtin_validate_locale(), pg_locale_struct::casemap_full, pg_locale_struct::collate_is_c, collid, pg_locale_struct::ctype, pg_locale_struct::ctype_is_c, ctype_methods_builtin, pg_locale_struct::deterministic, elog, ERROR, GetDatabaseEncoding(), HeapTupleIsValid, pg_locale_struct::locale, MemoryContextAllocZero(), MemoryContextStrdup(), MyDatabaseId, ObjectIdGetDatum(), ReleaseSysCache(), SearchSysCache1(), SysCacheGetAttrNotNull(), and TextDatumGetCString.
Referenced by create_pg_locale(), and init_database_collation().
Definition at line 236 of file pg_locale_icu.c.
References pg_locale_struct::collate, pg_locale_struct::collate_is_c, collid, pg_locale_struct::ctype, pg_locale_struct::ctype_is_c, pg_locale_struct::deterministic, elog, ereport, errcode(), errmsg(), ERROR, GetDatabaseEncoding(), GETSTRUCT(), HeapTupleIsValid, pg_locale_struct::locale, MemoryContextAllocZero(), MemoryContextStrdup(), MyDatabaseId, ObjectIdGetDatum(), PG_UTF8, ReleaseSysCache(), SearchSysCache1(), SysCacheGetAttr(), SysCacheGetAttrNotNull(), and TextDatumGetCString.
Referenced by create_pg_locale(), and init_database_collation().
Definition at line 669 of file pg_locale_libc.c.
References pg_locale_struct::collate, pg_locale_struct::collate_is_c, collate_methods_libc, collid, pg_locale_struct::ctype, pg_locale_struct::ctype_is_c, ctype_methods_libc_other_mb, ctype_methods_libc_sb, ctype_methods_libc_utf8, pg_locale_struct::deterministic, elog, ERROR, GetDatabaseEncoding(), HeapTupleIsValid, if(), locale_t, pg_locale_struct::lt, make_libc_collator(), MemoryContextAllocZero(), MyDatabaseId, ObjectIdGetDatum(), pg_database_encoding_max_length(), PG_UTF8, ReleaseSysCache(), SearchSysCache1(), SysCacheGetAttrNotNull(), and TextDatumGetCString.
Referenced by create_pg_locale(), and init_database_collation().
Definition at line 469 of file pg_locale.c.
References encoding, ereport, errcode(), errmsg(), ERROR, free, pfree(), pg_any_to_server(), and str.
Referenced by PGLC_localeconv().
Definition at line 419 of file pg_locale.c.
References free.
Referenced by PGLC_localeconv().
Definition at line 1217 of file pg_locale.c.
References get_collation_actual_version_builtin(), and get_collation_actual_version_libc().
Referenced by AlterCollation(), AlterDatabaseRefreshColl(), CheckMyDatabase(), create_pg_locale(), createdb(), DefineCollation(), pg_collation_actual_version(), pg_database_collation_actual_version(), and pg_import_system_collations().
Definition at line 253 of file pg_locale_builtin.c.
References ereport, errcode(), errmsg(), and ERROR.
Referenced by get_collation_actual_version().
Definition at line 911 of file pg_locale_libc.c.
References ereport, errmsg(), ERROR, locale_t, pg_strcasecmp(), pg_strncasecmp(), psprintf(), and pstrdup().
Referenced by get_collation_actual_version().
Definition at line 1502 of file pg_locale.c.
References ereport, errcode(), errmsg(), ERROR, MaxAllocSize, Min, palloc(), pfree(), and repalloc().
Referenced by createdb(), DefineCollation(), and pg_import_system_collations().
Definition at line 1560 of file pg_locale.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, i, icu_validation_level, IsBinaryUpgrade, and WARNING.
Referenced by createdb(), and DefineCollation().
Definition at line 1124 of file pg_locale.c.
References Assert(), create_pg_locale_builtin(), create_pg_locale_icu(), create_pg_locale_libc(), default_locale, elog, ERROR, GETSTRUCT(), HeapTupleIsValid, pg_locale_struct::is_default, MyDatabaseId, ObjectIdGetDatum(), PGLOCALE_SUPPORT_ERROR, ReleaseSysCache(), SearchSysCache1(), and TopMemoryContext.
Referenced by CheckMyDatabase().
Definition at line 1166 of file pg_locale.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, AssertCouldGetRelation(), CollationCache, CollationCacheContext, collid, create_pg_locale(), default_locale, elog, ERROR, last_collation_cache_locale, last_collation_cache_oid, collation_cache_entry::locale, OidIsValid, and TopMemoryContext.
Referenced by bpchareq(), bpcharne(), btvarstrequalimage(), convert_string_datum(), DefineCollation(), Generic_Text_IC_like(), GenericMatchText(), hashbpchar(), hashbpcharextended(), hashtext(), hashtextextended(), like_fixed_prefix(), make_greater_string(), match_pattern_prefix(), pg_set_regex_collation(), spg_text_inner_consistent(), str_casefold(), str_initcap(), str_tolower(), str_toupper(), text_position(), text_position_setup(), text_starts_with(), texteq(), textne(), varstr_cmp(), and varstr_sortsupport().
Definition at line 165 of file pg_locale.c.
References DEBUG3, elog, FATAL, GetDatabaseEncoding(), locale, LOCALE_NAME_BUFLEN, setenv, setlocale, SetMessageEncoding(), and strlcpy().
Referenced by assign_locale_messages(), CheckMyDatabase(), and init_locale().
Definition at line 1270 of file pg_locale.c.
References locale.
Referenced by varstrfastcmp_locale().
Definition at line 1255 of file pg_locale.c.
References locale.
Referenced by str_casefold().
Definition at line 1290 of file pg_locale.c.
References locale.
Referenced by MatchText(), text_position_next_internal(), and varstr_cmp().
Definition at line 1345 of file pg_locale.c.
References generate_unaccent_rules::dest, and locale.
Referenced by hashbpchar(), hashbpcharextended(), hashtext(), and hashtextextended().
Definition at line 1392 of file pg_locale.c.
References generate_unaccent_rules::dest, and locale.
Definition at line 1320 of file pg_locale.c.
References generate_unaccent_rules::dest, and locale.
Referenced by convert_string_datum(), and varstr_abbrev_convert().
Definition at line 1304 of file pg_locale.c.
References locale.
Referenced by varstr_sortsupport().
Definition at line 1367 of file pg_locale.c.
References generate_unaccent_rules::dest, and locale.
Referenced by varstr_abbrev_convert().
Definition at line 1356 of file pg_locale.c.
References locale.
Referenced by varstr_abbrev_convert().
Definition at line 499 of file pg_locale.c.
References CurrentLocaleConvValid, db_encoding_convert(), elog, encoding, ereport, errcode(), errmsg(), ERROR, free_struct_lconv(), locale_monetary, locale_numeric, PG_CATCH, PG_END_TRY, pg_get_encoding_from_locale(), pg_localeconv_free(), pg_localeconv_r(), PG_RE_THROW, PG_SQL_ASCII, PG_TRY, and struct_lconv_is_valid().
Referenced by cash_in(), cash_numeric(), cash_out(), int4_cash(), int8_cash(), NUM_prepare_locale(), and numeric_cash().
Definition at line 438 of file pg_locale.c.
Referenced by PGLC_localeconv().
Definition at line 137 of file pg_locale.c.
Referenced by pg_newlocale_from_collation().
Definition at line 136 of file pg_locale.c.
Referenced by pg_newlocale_from_collation().
Definition at line 109 of file pg_locale.c.
Referenced by assign_locale_time(), and cache_locale_time().
Definition at line 108 of file pg_locale.c.
Referenced by assign_locale_monetary(), assign_locale_numeric(), and PGLC_localeconv().
Definition at line 103 of file pg_locale.c.
Referenced by CheckMyDatabase(), t_isalnum(), t_isalpha(), and TParserInit().
Definition at line 105 of file pg_locale.c.
Referenced by init_database_collation(), and pg_newlocale_from_collation().
Definition at line 88 of file pg_locale.c.
Referenced by createdb(), DefineCollation(), and icu_validate_locale().
Definition at line 144 of file pg_locale.c.
Referenced by pg_newlocale_from_collation().
Definition at line 143 of file pg_locale.c.
Referenced by pg_newlocale_from_collation().
Definition at line 83 of file pg_locale.c.
Definition at line 84 of file pg_locale.c.
Referenced by PGLC_localeconv().
Definition at line 85 of file pg_locale.c.
Referenced by PGLC_localeconv().
Definition at line 86 of file pg_locale.c.
Referenced by cache_locale_time().
Definition at line 97 of file pg_locale.c.
Referenced by cache_locale_time(), DCH_from_char(), and DCH_to_char().
Definition at line 99 of file pg_locale.c.
Referenced by cache_locale_time(), DCH_from_char(), and DCH_to_char().
Definition at line 98 of file pg_locale.c.
Referenced by cache_locale_time(), DCH_from_char(), and DCH_to_char().
Definition at line 100 of file pg_locale.c.
Referenced by cache_locale_time(), DCH_from_char(), and DCH_to_char().