Mention CITEXT in the FAQ
Started by David E. Wheelerabout 17 years ago2 messages
Quick patch to mention CITEXT in the parts of the FAQ that discuss
case-insensitive comparisons.
Best,
David
Attachments:
citext_faq.patchapplication/octet-stream; name=citext_faq.patch; x-unix-mode=0600Download
rgIndex: doc/src/FAQ/FAQ.html
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/FAQ/FAQ.html,v
retrieving revision 1.421
diff -u -w -r1.421 FAQ.html
--- doc/src/FAQ/FAQ.html 1 Jan 2009 17:23:33 -0000 1.421
+++ doc/src/FAQ/FAQ.html 8 Jan 2009 18:02:52 -0000
@@ -815,8 +815,10 @@
<LI>The search string can not start with a character class,
e.g. [a-e].</LI>
<LI>Case-insensitive searches such as <SMALL>ILIKE</SMALL> and
- <I>~*</I> do not utilize indexes. Instead, use expression
- indexes, which are described in section <a href="#item4.8">4.8</a>.</LI>
+ <I>~*</I> do not utilize indexes on core PostgreSQL string types. Instead,
+ use the <I>contrib/citext</I> case-insensitive text type or expression
+ indexes, which are described in section
+ <a href="#item4.8">4.8</a>.</LI>
<LI>The default <I>C</I> locale must be used during
<i>initdb</i> because it is not possible to know the next-greatest
character in a non-C locale. You can create a special
@@ -840,8 +842,14 @@
case-insensitive variant of <SMALL>LIKE</SMALL> is called
<SMALL>ILIKE</SMALL>.</P>
- <P>Case-insensitive equality comparisons are normally expressed
- as:</P>
+ <P>The simplest way to ensure transparent case-insensitive comparisons of
+ values is to tse the <I>contrib/citext</I> case-insensitive data type,
+ which ensures that <B>all</B> comparisons are case-insensitive. It also
+ allows you to easily create case-insentitive <SMALL>UNIQUE</SMALL> primary
+ key constraints.</p>
+
+ <P>If <I>contrib/citext</i> isn't an option, Case-insensitive equality
+ comparisons are normally expressed as:</P>
<PRE>
SELECT *
FROM tab