Re: Simple Question: Case sensitivity
| От | Tomas Berndtsson |
|---|---|
| Тема | Re: Simple Question: Case sensitivity |
| Дата | |
| Msg-id | 80ofyj0y1h.fsf@junk.nocrew.org обсуждение исходный текст |
| Ответ на | RE: Simple Question: Case sensitivity ("Hancock, David (DHANCOCK)" <DHANCOCK@arinc.com>) |
| Ответы |
Re: Simple Question: Case sensitivity
|
| Список | pgsql-general |
Tom Lane <tgl@sss.pgh.pa.us> writes:
> Tomas Berndtsson <tomas@nocrew.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
В списке pgsql-general по дате отправления: