12/17/2023 0 Comments Postgresql create database encoding![]() ![]() SELECT a < ('foo' COLLATE "fr_FR") FROM test1 The < comparison is performed according to de_DE rules, because the expression combines an implicitly derived collation with the default collation. If it does, an error will be raised at run-time.įor example, consider this table definition: This is not an error condition unless the particular function being invoked requires knowledge of the collation it should apply. If there are conflicting non-default implicit collations among the input expressions, then the combination is deemed to have indeterminate collation. Otherwise, the result is the default collation. If any non-default collation is present, that is the result of the collation combination. Otherwise, all input expressions must have the same implicit collation derivation or the default collation. If any explicitly derived collation is present, that is the result of the collation combination. If any input expression has an explicit collation derivation, then all explicitly derived collations among the input expressions must be the same, otherwise an error is raised. When multiple collations need to be combined, for example in a function call, the following rules are used: An explicit collation derivation occurs when a COLLATE clause is used all other collation derivations are implicit. ![]() This distinction affects how collations are combined when multiple different collations appear in an expression. The collation derivation of an expression can be implicit or explicit. If the result of the function or operator call is of a collatable data type, the collation is also used at parse time as the defined collation of the function or operator expression, in case there is a surrounding expression that requires knowledge of its collation. In addition to comparison operators, collations are taken into account by functions that convert between lower and upper case letters, such as lower, upper, and initcap by pattern matching operators and by to_char and related functions.įor a function or operator call, the collation that is derived by examining the argument collations is used at run time for performing the specified operation. The collation to apply for a function or operator call is derived from the arguments, as described below. The collation to apply for an ORDER BY clause is simply the collation of the sort key. ![]() This happens, for example, with ORDER BY clauses and function or operator calls such as <. When the database system has to perform an ordering or a character classification, it uses the collation of the input expression. In such cases, ordering operations and other operations that need to know the collation will fail. It is also possible for an expression's collation to be indeterminate. ![]() The collation of an expression can be the “ default” collation, which means the locale settings defined for the database. The collation of a more complex expression is derived from the collations of its inputs, as described below. If the expression is a constant, the collation is the default collation of the data type of the constant. User-defined base types can also be marked collatable, and of course a domain over a collatable data type is collatable.) If the expression is a column reference, the collation of the expression is the defined collation of the column. (The built-in collatable data types are text, varchar, and char. Conceptually, every expression of a collatable data type has a collation. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |