From: | "Alain TESIO" <tesio(at)easynet(dot)fr> |
---|---|
To: | <pgsql-general(at)postgreSQL(dot)org> |
Subject: | Using functions with indexes |
Date: | 1999-11-16 00:20:52 |
Message-ID: | 008c01bf2fc8$cd5c34c0$f65f72c3@atesio |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hello,
I want to use an index for comparisons on strings which are
not case-sensitive (I'm currently using col2=lower(col1))
The type of the column is char(30), it looks like I can't
use the function lower directly as it's not working on
the right type :
dip=> create index idx_tmpplayer_add_low on TMPPLAYER ( lower ( EM_ADDRESS )
text_ops );
ERROR: BuildFuncTupleDesc: function 'lower(bpchar)' does not exist
But I can't manage to define such a function I need for the index, what's
the trick ?
dip=> create function mylower(char) returns char as 'select lower($1)'
language 'sql';
ERROR: return type mismatch in function: declared to return char, returns
text
dip=> create function mylower(char) returns char as 'select
char(lower(char_text($1)))' language 'sql';
ERROR: parser: parse error at or near "lower"
Thanks
Alain
From | Date | Subject | |
---|---|---|---|
Next Message | Aaron J. Seigo | 1999-11-16 00:34:02 | Re: [GENERAL] Basic question about indexes (6.5.2) |
Previous Message | Alain TESIO | 1999-11-16 00:16:32 | Basic question about indexes (6.5.2) |