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. --- src/backend/libpq/hba.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/backend/libpq/hba.c') diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c index 1f79c8fe00..f25505feb3 100644 --- a/src/backend/libpq/hba.c +++ b/src/backend/libpq/hba.c @@ -25,6 +25,7 @@ #include #include +#include "catalog/pg_collation.h" #include "libpq/ip.h" #include "libpq/libpq.h" #include "regex/regex.h" @@ -1781,7 +1782,7 @@ parse_ident_usermap(List *line, int line_number, const char *usermap_name, * XXX: Major room for optimization: regexps could be compiled when * the file is loaded and then re-used in every connection. */ - r = pg_regcomp(&re, wstr, wlen, REG_ADVANCED); + r = pg_regcomp(&re, wstr, wlen, REG_ADVANCED, C_COLLATION_OID); if (r) { char errstr[100]; -- cgit v1.2.1