BUG #13938: CAST error on Index "function must be immutable"

From: kurt(at)kwnet(dot)at
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #13938: CAST error on Index "function must be immutable"
Date: 2016-02-09 14:42:01
Message-ID: 20160209144201.2572.15861@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Joe Conway 2016-02-09 15:29:08 Re: BUG #13934: wrong result of split_part with char value
Previous Message Andrew Dunstan 2016-02-09 14:37:41 Re: BUG #13936: jsonb_object() -> ERROR: unknown type of jsonb container