BUG #5781: unaccent() function should be marked IMMUTABLE - Mailing list pgsql-bugs

From Grant Hutchins and Peter Jaros
Subject BUG #5781: unaccent() function should be marked IMMUTABLE
Date
Msg-id 201012021544.oB2FiTn1041521@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #5781: unaccent() function should be marked IMMUTABLE  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: "Thomas Bakketun"
Date:
Subject: BUG #5780: Case insensitive regular expressions
Next
From: Jorge Augusto Meira
Date:
Subject: Problems with max_connections parameter