pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Gregory S. Williamson <gsw@globexplorer.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: lower/upper functions and strings in searches
Date: Thu, 14 Aug 2003 17:00:19 -0700 (PDT)
Message-ID: <20030814165738.M98150-100000@megazone.bigpanda.com> (raw)
In-Reply-To: <71E37EF6B7DCC1499CEA0316A256832801057071@loki.globexplorer.com>

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




view thread (3+ messages)  latest in thread

Message-ID: <20030814165738.M98150-100000@megazone.bigpanda.com>
Permalink:  ../20030814165738.M98150-100000@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20030814165738.M98150-100000@megazone.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone.bigpanda.com, gsw@globexplorer.com
  Subject: Re: lower/upper functions and strings in searches
  In-Reply-To: <20030814165738.M98150-100000@megazone.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox