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).