Re: ORDER BY case insensitive?

From: Keith Gray <keith(at)heart(dot)com(dot)au>
To: Jason Earl <jdearl(at)yahoo(dot)com>
Cc: SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: ORDER BY case insensitive?
Date: 2001-10-04 23:56:48
Message-ID: 3BBCF740.931A32AD@heart.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)heart(dot)com(dot)au

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-10-05 00:32:08 Re: ORDER BY case insensitive?
Previous Message Keith Gray 2001-10-04 23:50:49 Re: Beginner's List