aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2001-05-07 19:58:31 +0000
committerBruce Momjian <bruce@momjian.us>2001-05-07 19:58:31 +0000
commit5fdae774a1e33826a76377b481b999bd7d6d637d (patch)
tree3c44c1c078dc792e44ce5004a091dcdd03300346 /doc/src
parent465cf168eb6151275016486fe2d2c629fed967ca (diff)
downloadpostgresql-5fdae774a1e33826a76377b481b999bd7d6d637d.tar.gz
postgresql-5fdae774a1e33826a76377b481b999bd7d6d637d.zip
Add mention of functional indexes for case-insensitive comparisons.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/FAQ/FAQ.html21
1 files changed, 19 insertions, 2 deletions
diff --git a/doc/src/FAQ/FAQ.html b/doc/src/FAQ/FAQ.html
index 3e4a0d9b2e6..8904661782c 100644
--- a/doc/src/FAQ/FAQ.html
+++ b/doc/src/FAQ/FAQ.html
@@ -112,7 +112,8 @@
<A href="#4.11">4.11</A>) What is an R-tree index?<BR>
<A href="#4.12">4.12</A>) What is the Genetic Query Optimizer?<BR>
<A href="#4.13">4.13</A>) How do I perform regular expression
- searches and case-insensitive regular expression searches?<BR>
+ searches and case-insensitive regular expression searches? How do I
+ use an index for case-insensitive searches?<BR>
<A href="#4.14">4.14</A>) In a query, how do I detect if a field
is <SMALL>NULL</SMALL>?<BR>
<A href="#4.15">4.15</A>) What is the difference between the
@@ -957,13 +958,29 @@ Maximum number of indexes on a table? unlimited
search.</P>
<H4><A name="4.13">4.13</A>) How do I perform regular expression
- searches and case-insensitive regular expression searches?</H4>
+ searches and case-insensitive regular expression searches? How do I
+ use an index for case-insensitive searches?</H4>
<P>The <I>~</I> operator does regular expression matching, and
<I>~*</I> does case-insensitive regular expression matching. The
case-insensitive variant of <SMALL>LIKE</SMALL> is called
<SMALL>ILIKE</SMALL> in PostgreSQL 7.1 and later.</P>
+ <P>Case-insensitive equality comparisons are normally expressed as:
+
+ <PRE>
+ SELECT *
+ FROM tab
+ WHERE lower(col) = 'abc'
+ </PRE>
+
+ This will not use an standard index. However, if you create a
+ functional index, it will be used:
+
+ <PRE>
+ CREATE INDEX tabindex on tab (lower(col));
+ </PRE>
+
<H4><A name="4.14">4.14</A>) In a query, how do I detect if a field
is <SMALL>NULL</SMALL>?</H4>