diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-01-03 22:39:42 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-01-03 22:39:42 +0000 |
commit | 15888bf0c0d048b462f6e703caba93669e40f0c2 (patch) | |
tree | 4f627ad6d4e97cec78c79b6d66a4afaf839539b9 /src/backend/utils/adt/regexp.c | |
parent | 34aabc20712723fc8a6a3974b724934ea304eaae (diff) | |
download | postgresql-15888bf0c0d048b462f6e703caba93669e40f0c2.tar.gz postgresql-15888bf0c0d048b462f6e703caba93669e40f0c2.zip |
Fix regex_fixed_prefix() to cope reasonably well with regex patterns of the
form '^(foo)$'. Before, these could never be optimized into indexscans.
The recent changes to make psql and pg_dump generate such patterns (for \d
commands and -t and related switches, respectively) therefore represented
a big performance hit for people with large pg_class catalogs, as seen in
recent gripe from Erik Jones. While at it, be more paranoid about
case-sensitivity checking in multibyte encodings, and fix some other
corner cases in which a regex might be interpreted too liberally.
Diffstat (limited to 'src/backend/utils/adt/regexp.c')
-rw-r--r-- | src/backend/utils/adt/regexp.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/backend/utils/adt/regexp.c b/src/backend/utils/adt/regexp.c index c0da9934e52..5c7ad349d42 100644 --- a/src/backend/utils/adt/regexp.c +++ b/src/backend/utils/adt/regexp.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/regexp.c,v 1.60.2.2 2006/04/13 18:01:38 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/regexp.c,v 1.60.2.3 2007/01/03 22:39:42 tgl Exp $ * * Alistair Crooks added the code for the regex caching * agc - cached the regular expressions used - there's a good chance @@ -625,3 +625,12 @@ similar_escape(PG_FUNCTION_ARGS) PG_RETURN_TEXT_P(result); } + +/* + * report whether regex_flavor is currently BASIC + */ +bool +regex_flavor_is_basic(void) +{ + return (regex_flavor == REG_BASIC); +} |