From 5fdae774a1e33826a76377b481b999bd7d6d637d Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Mon, 7 May 2001 19:58:31 +0000 Subject: [PATCH] Add mention of functional indexes for case-insensitive comparisons. --- doc/src/FAQ/FAQ.html | 21 +++++++++++++++++++-- 1 file 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 @@ 4.11) What is an R-tree index?
4.12) What is the Genetic Query Optimizer?
4.13) How do I perform regular expression - searches and case-insensitive regular expression searches?
+ searches and case-insensitive regular expression searches? How do I + use an index for case-insensitive searches?
4.14) In a query, how do I detect if a field is NULL?
4.15) What is the difference between the @@ -957,13 +958,29 @@ Maximum number of indexes on a table? unlimited search.

4.13) How do I perform regular expression - searches and case-insensitive regular expression searches?

+ searches and case-insensitive regular expression searches? How do I + use an index for case-insensitive searches?

The ~ operator does regular expression matching, and ~* does case-insensitive regular expression matching. The case-insensitive variant of LIKE is called ILIKE in PostgreSQL 7.1 and later.

+

Case-insensitive equality comparisons are normally expressed as: + +

+    SELECT *
+    FROM tab
+    WHERE lower(col) = 'abc'
+    
+ + This will not use an standard index. However, if you create a + functional index, it will be used: + +
+    CREATE INDEX tabindex on tab (lower(col));
+    
+

4.14) In a query, how do I detect if a field is NULL?

-- 2.39.5