kurt@kwnet.at writes:
> 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"
This is not a bug. The cast from text to interval isn't immutable because
its results may vary depending on the IntervalStyle setting.
> --the same error when casting to TIMESTAMP (with or without time zone)
Same, although it's DateStyle and/or TimeZone that affect this.
regards, tom lane