Received: from gw.heart.com.au (mail.heart.com.au [203.12.235.237]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f94NvRn08433 for ; Thu, 4 Oct 2001 19:57:27 -0400 (EDT) (envelope-from keith@heart.com.au) Received: from tardis.heart.com.au (IDENT:root@tardis.heart.com.au [192.168.0.42]) by gw.heart.com.au (8.9.3/8.9.3) with ESMTP id KAA25892; Fri, 5 Oct 2001 10:00:58 +1000 Received: from heart.com.au ([192.168.0.87]) by tardis.heart.com.au (8.9.3/8.8.7) with ESMTP id JAA05686; Fri, 5 Oct 2001 09:57:22 +1000 Message-ID: <3BBCF740.931A32AD@heart.com.au> Date: Fri, 05 Oct 2001 09:56:48 +1000 From: Keith Gray X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Jason Earl CC: SQL Subject: Re: ORDER BY case insensitive? References: <20011004212255.3654.qmail@web10002.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200110/72 X-Sequence-Number: 5027 Jason Earl wrote: > > You can, however, create an index like: > > create index MyTable_lower_idx on MyTable > (lower(name)); > > It won't help with your particular query, but it > certainly would help for queries like: > > SELECT * FROM MyTable WHERE lower(name) = 'jason'; > How would PostgreSQL know to use the index MyTable_lower_idx when I do a ... SELECT * FROM MyTable WHERE lower(name) LIKE 'jas%'; -- Keith Gray Technical Development Manager Heart Consulting Services P/L mailto:keith@heart.com.au