Re: ORDER BY case insensitive? - Mailing list pgsql-sql

From Keith Gray
Subject Re: ORDER BY case insensitive?
Date
Msg-id 3BBCF740.931A32AD@heart.com.au
Whole thread Raw
In response to Re: ORDER BY case insensitive?  (Jason Earl <jdearl@yahoo.com>)
Responses Re: ORDER BY case insensitive?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Keith Gray
Date:
Subject: Re: Beginner's List
Next
From: Tom Lane
Date:
Subject: Re: ORDER BY case insensitive?