Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> Tomas Berndtsson <tomas(at)nocrew(dot)org> writes:
> > Related to this, is there any way to make an index for a table
> > case-insensitive? If you have an index, but use upper() in the select,
> > the index is not used.
>
> Sure, make a functional index:
>
> play=> create table foo (f1 text);
> CREATE
> play=> create index fooi on foo (upper(f1));
> CREATE
Ah, great, thanks. Couldn't see anything about that in the manual.
> This index will be considered for queries like:
>
> play=> explain select * from foo where upper(f1) = 'z';
Don't you need upper('z')?
Tomas