diff options
Diffstat (limited to 'src/test/regress/sql/regex.sql')
-rw-r--r-- | src/test/regress/sql/regex.sql | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/regress/sql/regex.sql b/src/test/regress/sql/regex.sql index 9fdcb2f5bd5..c29ed05d768 100644 --- a/src/test/regress/sql/regex.sql +++ b/src/test/regress/sql/regex.sql @@ -24,3 +24,13 @@ select 'abc abc abd' ~ '^(.+)( \1)+$' as f; select substring('asd TO foo' from ' TO (([a-z0-9._]+|"([^"]+|"")+")+)'); select substring('a' from '((a))+'); select substring('a' from '((a)+)'); + +-- Test conversion of regex patterns to indexable conditions +explain (costs off) select * from pg_proc where proname ~ 'abc'; +explain (costs off) select * from pg_proc where proname ~ '^abc'; +explain (costs off) select * from pg_proc where proname ~ '^abc$'; +explain (costs off) select * from pg_proc where proname ~ '^abcd*e'; +explain (costs off) select * from pg_proc where proname ~ '^abc+d'; +explain (costs off) select * from pg_proc where proname ~ '^(abc)(def)'; +explain (costs off) select * from pg_proc where proname ~ '^(abc)$'; +explain (costs off) select * from pg_proc where proname ~ '^(abc)?d'; |