Teach regular expression operators to honor collations.
Tom Lane <tgl@sss.pgh.pa.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/charset.sgml | modified | +22 −11 |
| src/backend/libpq/hba.c | modified | +2 −1 |
| src/backend/regex/Makefile | modified | +2 −1 |
| src/backend/regex/regc_locale.c | modified | +0 −165 |
| src/backend/regex/regcomp.c | modified | +10 −2 |
| src/backend/regex/regc_pg_locale.c | added | +649 −0 |
| src/backend/regex/regexec.c | modified | +3 −0 |
| src/backend/tsearch/spell.c | modified | +4 −1 |
| src/backend/utils/adt/regexp.c | modified | +32 −10 |
| src/include/regex/regex.h | modified | +3 −1 |
| src/test/regress/expected/collate.linux.utf8.out | modified | +74 −0 |
| src/test/regress/sql/collate.linux.utf8.sql | modified | +18 −0 |