From 1e16a8107db9a50435b39e09c6f9c52c45e63e1a Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 10 Apr 2011 18:02:17 -0400 Subject: Teach regular expression operators to honor collations. This involves getting the character classification and case-folding functions in the regex library to use the collations infrastructure. Most of this work had been done already in connection with the upper/lower and LIKE logic, so it was a simple matter of transposition. While at it, split out these functions into a separate source file regc_pg_locale.c, so that they can be correctly labeled with the Postgres project's license rather than the Scriptics license. These functions are 100% Postgres-written code whereas what remains in regc_locale.c is still mostly not ours, so lumping them both under the same copyright notice was getting more and more misleading. --- doc/src/sgml/charset.sgml | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/charset.sgml b/doc/src/sgml/charset.sgml index 72ba3337902..6b0793e2197 100644 --- a/doc/src/sgml/charset.sgml +++ b/doc/src/sgml/charset.sgml @@ -221,17 +221,21 @@ initdb --locale=sv_SE - The ability to use indexes with LIKE clauses - LIKEand locales + The upper, lower, and initcap + functions + upperand locales + lowerand locales - The upper, lower, and initcap - functions - upperand locales - lowerand locales + Pattern matching operators (LIKE, SIMILAR TO, + and POSIX-style regular expressions); locales affect both case + insensitive matching and the classification of characters by + character-class regular expressions + LIKEand locales + regular expressionsand locales @@ -241,6 +245,12 @@ initdb --locale=sv_SE to_charand locales + + + + The ability to use indexes with LIKE clauses + + @@ -319,8 +329,8 @@ initdb --locale=sv_SE collation - The collation feature allows specifying the sort order and certain - other locale aspects of data per-column, or even per-operation. + The collation feature allows specifying the sort order and character + classification behavior of data per-column, or even per-operation. This alleviates the restriction that the LC_COLLATE and LC_CTYPE settings of a database cannot be changed after its creation. @@ -351,8 +361,8 @@ initdb --locale=sv_SE - When the database system has to perform an ordering or a - comparison, it uses the collation of the input expression. This + When the database system has to perform an ordering or a character + classification, it uses the collation of the input expression. This happens, for example, with ORDER BY clauses and function or operator calls such as <. The collation to apply for an ORDER BY clause @@ -361,7 +371,8 @@ initdb --locale=sv_SE below. 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. + initcap; by pattern matching operators; and by + to_char and related functions. -- cgit v1.2.3