Fix regex_fixed_prefix() to cope reasonably well with regex patterns of the

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 15888bf0c0d048b462f6e703caba93669e40f0c2
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2007-01-03T22:39:42Z
Releases: 8.1.6
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.

Files

PathChange+/−
src/backend/utils/adt/regexp.c modified +10 −1
src/backend/utils/adt/selfuncs.c modified +93 −44
src/include/utils/builtins.h modified +2 −1