PostgreSQL Source Code git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "access/table.h"
#include "access/xact.h"
#include "catalog/indexing.h"
#include "catalog/namespace.h"
#include "catalog/objectaccess.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_database.h"
#include "catalog/pg_namespace.h"
#include "commands/collationcmds.h"
#include "commands/comment.h"
#include "commands/dbcommands.h"
#include "commands/defrem.h"
#include "common/string.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/pg_locale.h"
#include "utils/rel.h"
#include "utils/syscache.h"
Go to the source code of this file.
Data Structures | |
struct | CollAliasData |
Macros | |
#define | READ_LOCALE_A_OUTPUT |
Functions | |
ObjectAddress | DefineCollation (ParseState *pstate, List *names, List *parameters, bool if_not_exists) |
void | IsThereCollationInNamespace (const char *collname, Oid nspOid) |
ObjectAddress | AlterCollation (AlterCollationStmt *stmt) |
Datum | pg_collation_actual_version (PG_FUNCTION_ARGS) |
static bool | normalize_libc_locale_name (char *new, const char *old) |
static int | cmpaliases (const void *a, const void *b) |
pg_attribute_unused () static int create_collation_from_locale(const char *locale | |
if (!pg_is_ascii(locale)) | |
if (enc< 0) | |
if (!PG_VALID_BE_ENCODING(enc)) | |
if (collid=CollationCreate(enc==PG_SQL_ASCII) | |
Datum | pg_import_system_collations (PG_FUNCTION_ARGS) |
Variables | |
int | nspid |
int int * | nvalidp |
int int int * | ncreatedp |
Oid | collid |
enc = pg_get_encoding_from_locale(locale, false) | |
#define READ_LOCALE_A_OUTPUT |
Definition at line 579 of file collationcmds.c.
ObjectAddress AlterCollation | ( | AlterCollationStmt * | stmt | ) |
Definition at line 424 of file collationcmds.c.
References aclcheck_error(), ACLCHECK_NOT_OWNER, CatalogTupleUpdate(), CStringGetTextDatum, elog, ereport, errhint(), errmsg(), ERROR, get_collation_actual_version(), get_collation_oid(), GETSTRUCT, GetUserId(), heap_freetuple(), heap_modify_tuple(), HeapTupleIsValid, InvokeObjectPostAlterHook, NameListToString(), NoLock, NOTICE, OBJECT_COLLATION, object_ownercheck(), ObjectAddressSet, ObjectIdGetDatum(), RelationGetDescr, RowExclusiveLock, SearchSysCacheCopy1, stmt, SysCacheGetAttr(), SysCacheGetAttrNotNull(), HeapTupleData::t_self, table_close(), table_open(), TextDatumGetCString, and values.
Referenced by ProcessUtilitySlow().
|
static |
Definition at line 627 of file collationcmds.c.
References a, b, and CollAliasData::localename.
Referenced by pg_import_system_collations().
ObjectAddress DefineCollation | ( | ParseState * | pstate, |
List * | names, | ||
List * | parameters, | ||
bool | if_not_exists | ||
) |
Definition at line 53 of file collationcmds.c.
References ACL_CREATE, aclcheck_error(), ACLCHECK_OK, builtin_locale_encoding(), builtin_validate_locale(), check_encoding_locale_matches(), CollationCreate(), collid, CommandCounterIncrement(), defGetBoolean(), defGetQualifiedName(), defGetString(), DefElem::defname, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, errorConflictingDefElem(), get_collation_actual_version(), get_collation_oid(), get_namespace_name(), GetDatabaseEncoding(), GETSTRUCT, GetUserId(), HeapTupleIsValid, icu_language_tag(), icu_validate_locale(), icu_validation_level, InvalidObjectAddress, is_encoding_supported_by_icu(), IsBinaryUpgrade, lfirst_node, list_length(), locale, DefElem::location, NOTICE, object_aclcheck(), OBJECT_SCHEMA, ObjectAddressSet, ObjectIdGetDatum(), OidIsValid, parser_errposition(), pg_newlocale_from_collation(), pg_strcasecmp(), QualifiedNameGetCreationNamespace(), ReleaseSysCache(), SearchSysCache1(), SysCacheGetAttr(), and TextDatumGetCString.
Referenced by ProcessUtilitySlow().
if | ( | ! | pg_is_asciilocale | ) |
if | ( | ! | PG_VALID_BE_ENCODINGenc | ) |
if | ( | collid = CollationCreate( | enc = = PG_SQL_ASCII | ) |
Definition at line 725 of file collationcmds.c.
if | ( | ) |
void IsThereCollationInNamespace | ( | const char * | collname, |
Oid | nspOid | ||
) |
Definition at line 396 of file collationcmds.c.
References CStringGetDatum(), ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, get_namespace_name(), GetDatabaseEncoding(), GetDatabaseEncodingName(), Int32GetDatum(), ObjectIdGetDatum(), and SearchSysCacheExists3.
Referenced by AlterObjectNamespace_internal(), and AlterObjectRename_internal().
|
static |
Definition at line 596 of file collationcmds.c.
Referenced by pg_import_system_collations().
pg_attribute_unused | ( | ) | const |
Datum pg_collation_actual_version | ( | PG_FUNCTION_ARGS | ) |
Definition at line 507 of file collationcmds.c.
References Assert, collid, cstring_to_text(), datlocprovider, ereport, errcode(), errmsg(), ERROR, get_collation_actual_version(), GETSTRUCT, HeapTupleIsValid, locale, MyDatabaseId, ObjectIdGetDatum(), PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, provider, ReleaseSysCache(), SearchSysCache1(), SysCacheGetAttrNotNull(), and TextDatumGetCString.
Datum pg_import_system_collations | ( | PG_FUNCTION_ARGS | ) |
Definition at line 836 of file collationcmds.c.
References _dosmaperr(), CollAliasData::alias, ClosePipeStream(), cmpaliases(), CollationCreate(), collid, CommandCounterIncrement(), CreateComments(), DEBUG1, elog, CollAliasData::enc, enc, ereport, errcode(), errcode_for_file_access(), errmsg(), ERROR, get_collation_actual_version(), GetUserId(), i, icu_language_tag(), len, locale, LOCALE_NAME_BUFLEN, CollAliasData::localename, name, normalize_libc_locale_name(), nspid, ObjectIdGetDatum(), OidIsValid, OpenPipeStream(), palloc(), PG_GETARG_OID, pg_is_ascii(), PG_RETURN_INT32, psprintf(), pstrdup(), qsort, repalloc(), SearchSysCacheExists1, superuser(), and WARNING.
Oid collid |
Definition at line 700 of file collationcmds.c.
Referenced by add_column_collation_dependency(), bpchar_sortsupport(), bpchareq(), bpcharne(), btnamesortsupport(), bttextsortsupport(), btvarstrequalimage(), check_collation_set(), citextcmp(), CollationGetCollid(), CollationIsVisible(), CollationIsVisibleExt(), convert_string_datum(), convert_to_scalar(), create_pg_locale(), create_pg_locale_builtin(), create_pg_locale_icu(), create_pg_locale_libc(), datetime_to_char_body(), DCH_from_char(), DCH_to_char(), DefineCollation(), do_to_timestamp(), ExecBuildGroupingEqual(), ExecBuildParamSetEqual(), executeDateTimeMethod(), find_expr_references_walker(), from_char_seq_search(), generate_collation_name(), get_atttypetypmodcoll(), hashbpchar(), hashbpcharextended(), hashtext(), hashtextextended(), lookup_collation(), mcv_get_match_bitmap(), mcv_match_expression(), namecmp(), nameeqtext(), namenetext(), ndistinct_for_combination(), parse_datetime(), pg_collation_actual_version(), pg_collation_for(), pg_import_system_collations(), pg_newlocale_from_collation(), ri_CompareWithCast(), seq_search_localized(), str_initcap(), str_initcap_z(), str_tolower(), str_tolower_z(), str_toupper(), str_toupper_z(), t_starts_with(), text_cmp(), text_isequal(), text_position(), text_position_setup(), text_starts_with(), texteq(), texteqname(), textne(), textnename(), to_date(), to_timestamp(), varstr_cmp(), and varstr_sortsupport().
return enc = pg_get_encoding_from_locale(locale, false) |
Definition at line 714 of file collationcmds.c.
Referenced by checkJsonOutputFormat(), coerceJsonFuncExpr(), encode_to_ascii(), encodingid_to_string(), get_encoding_id(), getJsonEncodingConst(), pg_import_system_collations(), pg_stat_statements_internal(), pg_to_ascii(), pg_valid_client_encoding(), pg_valid_server_encoding(), to_ascii_default(), to_ascii_enc(), and to_ascii_encname().
int int int* ncreatedp |
Definition at line 697 of file collationcmds.c.
int nspid |
Definition at line 696 of file collationcmds.c.
Referenced by CreateTableAsRelExists(), database_to_xml_internal(), get_namespace_name(), get_namespace_name_or_temp(), getDefaultACLs(), logicalrep_write_namespace(), map_sql_catalog_to_xmlschema_types(), map_sql_schema_to_xmlschema_types(), pg_import_system_collations(), RangeVarAdjustRelationPersistence(), RangeVarGetAndCheckCreationNamespace(), regnamespaceout(), schema_get_xml_visible_tables(), schema_to_xml(), schema_to_xml_and_xmlschema(), schema_to_xml_internal(), and schema_to_xmlschema_internal().
int int* nvalidp |
Definition at line 697 of file collationcmds.c.