I'm still trying to figure out an easy way to deal
with case insensitive queries systematically through
a ddl command. I tried something like:
CREATE FUNCTION UTrim (varchar) RETURNS varchar AS 'select
upper(trim(both from $1)) as result' LANGUAGE 'sql' with (iscachable)
create index poindex on shop (UTrim(purchase_order))
so I would assume all queries by purchase_order on shop would be
case insensitive and insensitive of leading + trailing spaces
save in the purchase_order column.
This isn't the case. Am I missing something?
Anyway, I'm worried that something like:
select * from shop where UTrim('po1') = UTrim(purchase_order) would be
inefficient. Does creating the index UTrim(purchase_order) speed that
query up? Is UTrim required in both the create index and select
statements to work properly and speedily?