I am trying to create an index that is case insensitive (i.e. by making
the index on UPPER(col) and then selecting using WHERE col =
Upper('str')). However, the column is defined as a varchar, and I have
been unable to get it working (expects type text)
Thanks
Michael Fork - CCNA - MCP - A+
Network Support - Toledo Internet Access - Toledo Ohio
test=# CREATE TABLE foo (bar VARCHAR(5));
CREATE
test=# CREATE INDEX idx_foo_bar ON foo(UPPER(bar));
ERROR: DefineIndex: function 'upper(varchar)' does not exist
test=# CREATE INDEX idx_foo_bar ON foo(UPPER(bar::text));
ERROR: parser: parse error at or near "::"
test=# CREATE INDEX idx_foo_bar ON foo(UPPER(CAST(bar AS TEXT)));
ERROR: parser: parse error at or near "cast"
test=# CREATE INDEX idx_foo_bar ON foo(UPPER(TEXT(bar)));
ERROR: parser: parse error at or near "("