aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-04-10 18:02:17 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-04-10 18:03:09 -0400
commit1e16a8107db9a50435b39e09c6f9c52c45e63e1a (patch)
treebf2231fc078b46004c7814ba871e3c38c1d8d52d /doc/src
parent210f95f1cd59c6fdfe0f84b922c19d8498ac377d (diff)
downloadpostgresql-1e16a8107db9a50435b39e09c6f9c52c45e63e1a.tar.gz
postgresql-1e16a8107db9a50435b39e09c6f9c52c45e63e1a.zip
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.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/charset.sgml33
1 files changed, 22 insertions, 11 deletions
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
<listitem>
<para>
- The ability to use indexes with <literal>LIKE</> clauses
- <indexterm><primary>LIKE</><secondary>and locales</></indexterm>
+ The <function>upper</>, <function>lower</>, and <function>initcap</>
+ functions
+ <indexterm><primary>upper</><secondary>and locales</></indexterm>
+ <indexterm><primary>lower</><secondary>and locales</></indexterm>
</para>
</listitem>
<listitem>
<para>
- The <function>upper</>, <function>lower</>, and <function>initcap</>
- functions
- <indexterm><primary>upper</><secondary>and locales</></indexterm>
- <indexterm><primary>lower</><secondary>and locales</></indexterm>
+ Pattern matching operators (<literal>LIKE</>, <literal>SIMILAR TO</>,
+ and POSIX-style regular expressions); locales affect both case
+ insensitive matching and the classification of characters by
+ character-class regular expressions
+ <indexterm><primary>LIKE</><secondary>and locales</></indexterm>
+ <indexterm><primary>regular expressions</><secondary>and locales</></indexterm>
</para>
</listitem>
@@ -241,6 +245,12 @@ initdb --locale=sv_SE
<indexterm><primary>to_char</><secondary>and locales</></indexterm>
</para>
</listitem>
+
+ <listitem>
+ <para>
+ The ability to use indexes with <literal>LIKE</> clauses
+ </para>
+ </listitem>
</itemizedlist>
</para>
@@ -319,8 +329,8 @@ initdb --locale=sv_SE
<indexterm zone="collation"><primary>collation</></>
<para>
- 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
<symbol>LC_COLLATE</symbol> and <symbol>LC_CTYPE</symbol> settings
of a database cannot be changed after its creation.
@@ -351,8 +361,8 @@ initdb --locale=sv_SE
</para>
<para>
- 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 <literal>ORDER BY</literal> clauses
and function or operator calls such as <literal>&lt;</literal>.
The collation to apply for an <literal>ORDER BY</literal> 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 <function>lower</>, <function>upper</>, and
- <function>initcap</>.
+ <function>initcap</>; by pattern matching operators; and by
+ <function>to_char</> and related functions.
</para>
<para>