Re: [SQL] Cannot CREATE INDEX that contains a function

2001-01-25 Thread Tom Lane
Roberto Bertolusso <[EMAIL PROTECTED]> writes: > testdb=# CREATE TABLE test (username varchar(50)); > CREATE > testdb=# CREATE UNIQUE INDEX test_index ON test (lower(username)); > ERROR: DefineIndex: function 'lower(varchar)' does not exist Short answer in 7.0.* is to make the column be type text

[SQL] Cannot CREATE INDEX that contains a function

2001-01-25 Thread Roberto Bertolusso
I am testing Postgresql-7.0.3 I would like to have an index all in lowercase to speed up this select: SELECT * FROM test WHERE lower(username) = 'max'; Please tell me what am I doing wrong: In psql... testdb=# CREATE TABLE test (username varchar(50)); CREATE testdb=# CREATE UNIQUE INDEX test_ind