Re: index not used in ( varchar = text )

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: index not used in ( varchar = text )
Дата
Msg-id 20971.1046051478@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: index not used in ( varchar = text )  ("Gaetano Mendola" <mendola@bigfoot.com>)
Список pgsql-admin
"Gaetano Mendola" <mendola@bigfoot.com> writes:
>> Why would you want to cast that to text, if your field is a varchar?

> Of course that example was a semplification of a real
> situation:
> ..........
> my_login ALIAS FOR $1;

> SELECT *
> FROM user_login
> WHERE login = my_login;

> and $1 is of type TEXT.

So declare it as VARCHAR.  Or cast it to varchar.  You need to get rid
of the datatype ambiguity.  "text = text" is a different operator from
"varchar = varchar".

            regards, tom lane

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Gaetano Mendola"
Дата:
Сообщение: Re: index not used in ( varchar = text )
Следующее
От:
Дата:
Сообщение: Re: \d tablename with psql over slow links...