DefineIndex: function 'lower(varchar)' does not exist !?!?!? - Mailing list pgsql-general

From Philip Hallstrom
Subject DefineIndex: function 'lower(varchar)' does not exist !?!?!?
Date
Msg-id 200006081900.MAA67608@illiad.adhesivemedia.com
Whole thread Raw
List pgsql-general
Hi -
    I swore that somewhere I read that you could create an index on a
function of one of the columns to speed things up... instead of having to
do:
SELECT... WHERE LOWER(col) = LOWER('string')
but I'm having a devil of a time getting it to work.  Can anyone tell me
what I'm doing wrong?  Do I need to create a separate SQL function called
say "varcharlower" which does "lower(text(x))" ???
Thanks!
test=> create table foo ( x varchar(10));
CREATE
test=> create index foo_idx on foo (lower(x));
ERROR:  DefineIndex: function 'lower(varchar)' does not exist
test=> create index foo_idx on foo (lower(text(x)));
ERROR:  parser: parse error at or near "("
test=> create table bar ( x text);
CREATE
test=> create index foo_idx on bar (lower(x));
CREATE


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Procedure Size Limitation
Next
From: "John Daniels"
Date:
Subject: FreeBSD PostgreSQL7 port and v7.0.2