The following bug has been logged on the website:
Bug reference: 13938
Logged by: Kurt Weiß
Email address: kurt(at)kwnet(dot)at
PostgreSQL version: 9.1.14
Operating system: linux
Description:
CREATE TABLE ud_data (
val TEXT,
);
CREATE INDEX ud_data_FLOAT ON ud_data(CAST(val AS FLOAT)) WHERE i_type=3;
--accepted as valid.
CREATE INDEX ud_data_TIME ON ud_data(CAST(val AS INTERVAL)) WHERE
i_type=10;
--results in error "functions in index expression must be marked IMMUTABLE"
--the same error when casting to TIMESTAMP (with or without time zone)