@@ -112,7 +112,8 @@ <H2>Operational Questions</H2>
112
112
< A href ="#4.11 "> 4.11</ A > ) What is an R-tree index?< BR >
113
113
< A href ="#4.12 "> 4.12</ A > ) What is the Genetic Query Optimizer?< BR >
114
114
< A href ="#4.13 "> 4.13</ A > ) How do I perform regular expression
115
- searches and case-insensitive regular expression searches?< BR >
115
+ searches and case-insensitive regular expression searches? How do I
116
+ use an index for case-insensitive searches?< BR >
116
117
< A href ="#4.14 "> 4.14</ A > ) In a query, how do I detect if a field
117
118
is < SMALL > NULL</ SMALL > ?< BR >
118
119
< A href ="#4.15 "> 4.15</ A > ) What is the difference between the
@@ -957,13 +958,29 @@ <H4><A name="4.12">4.12</A>) What is the Genetic Query
957
958
search.</ P >
958
959
959
960
< H4 > < A name ="4.13 "> 4.13</ A > ) How do I perform regular expression
960
- searches and case-insensitive regular expression searches?</ H4 >
961
+ searches and case-insensitive regular expression searches? How do I
962
+ use an index for case-insensitive searches?</ H4 >
961
963
962
964
< P > The < I > ~</ I > operator does regular expression matching, and
963
965
< I > ~*</ I > does case-insensitive regular expression matching. The
964
966
case-insensitive variant of < SMALL > LIKE</ SMALL > is called
965
967
< SMALL > ILIKE</ SMALL > in PostgreSQL 7.1 and later.</ P >
966
968
969
+ < P > Case-insensitive equality comparisons are normally expressed as:
970
+
971
+ < PRE >
972
+ SELECT *
973
+ FROM tab
974
+ WHERE lower(col) = 'abc'
975
+ </ PRE >
976
+
977
+ This will not use an standard index. However, if you create a
978
+ functional index, it will be used:
979
+
980
+ < PRE >
981
+ CREATE INDEX tabindex on tab (lower(col));
982
+ </ PRE >
983
+
967
984
< H4 > < A name ="4.14 "> 4.14</ A > ) In a query, how do I detect if a field
968
985
is < SMALL > NULL</ SMALL > ?</ H4 >
969
986
0 commit comments