The following bug has been logged online:
Bug reference: 5781
Logged by: Grant Hutchins and Peter Jaros
Email address: grant@pivotallabs.com
PostgreSQL version: 9.0.1
Operating system: Mac OS X 10.6.4
Description: unaccent() function should be marked IMMUTABLE
Details:
The unaccent(text) function supplied by contrib/unaccent is marked VOLATILE.
This prevents it from being used in indexes. We believe that the function
meets the requirements to be marked IMMUTABLE.
=# CREATE TABLE foo ();
CREATE TABLE
=# CREATE INDEX bar ON foo ( unaccent('baz') );
ERROR: functions in index expression must be marked IMMUTABLE
=# ALTER FUNCTION unaccent(text) IMMUTABLE;
ALTER FUNCTION
=# CREATE INDEX bar ON foo ( unaccent('baz') );
CREATE INDEX