Re: lower/upper functions and strings in searches

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: lower/upper functions and strings in searches
Дата
Msg-id 20030814165738.M98150-100000@megazone.bigpanda.com
обсуждение исходный текст
Ответ на lower/upper functions and strings in searches  ("Gregory S. Williamson" <gsw@globexplorer.com>)
Список pgsql-sql
On Thu, 14 Aug 2003, Gregory S. Williamson wrote:

> I am obviuously doing some newbie trick, and I ordinarily would spend time browing the archives, but the
archives.postgresql.orgsite seems to be absurdly slow.
 
>
> This is 7.3.3 on a linux box.
>
> I have a bunch of data with state, city, county and country names. When our application does a search for an exact
match:
>
> select * from gx_geotowns where l_state = 'NM';
>   I get back a lot of rows of cities in New Mexico, as expected.
>
> If I try:
>
> select * from gx_geotowns where upper(l_state) = upper('nm');

You say the column is of type CHAR(), but CHAR(2) or something else?

For 7.3 and earlier, you're going to get a text comparison which means
that trailing spaces are significant (it's effectively no pad in text vs
pad space in char).



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

Предыдущее
От: "Gregory S. Williamson"
Дата:
Сообщение: lower/upper functions and strings in searches
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: lower/upper functions and strings in searches