Re: lower/upper functions and strings in searches - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: lower/upper functions and strings in searches
Date
Msg-id 20030814165738.M98150-100000@megazone.bigpanda.com
Whole thread Raw
In response to lower/upper functions and strings in searches  ("Gregory S. Williamson" <gsw@globexplorer.com>)
List 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 by date:

Previous
From: "Gregory S. Williamson"
Date:
Subject: lower/upper functions and strings in searches
Next
From: Josh Berkus
Date:
Subject: Re: lower/upper functions and strings in searches