How to deal with IMMUTABLE error in indexes that work with timestamps
Wednesday, March 19th, 2008Say that in an older version of PostgreSQL you had an index like this:
-
CREATE INDEX logTypeDay ON myLog (eventType, date_trunc(‘day’, creationTime));
and now after upgrading to 8.1+ you’re getting:
ERROR: functions in index expression must be marked IMMUTABLE
