also, just to clarify - i didn't want a case insensitive compare but a
specific sql generated

just to give a quick illustration

With this table structure:

    CREATE TABLE names (
      id serial not null primary key ,
      name varchar(255) not null
    );
    CREATE UNIQUE INDEX names_name_uidx ON names(lower(name));

Postgres and Oracle will optimize this search against the index:
    """SELECT * FROM names WHERE lower(name) = '%s'""" %
search.lower()

Doing an ilike or similar won't work -- while the effect is a "case
insensitive search", the search is actually case sensitive.

The nice things about function based indexes like this, is that you
can both preserve uniqueness on a string ( usernames, email addresses,
etc ) and also gain a little speed on your most often used lookups.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to