On 1/4/19 2:21 PM, Ken Tanzer wrote: > > I've tried various ways of getting to a date (::date, LEFT(x,10)::date, > etc.), but all of them throw the error "functions in index expression > must be marked IMMUTABLE."
?: '2014-10-23T00:00:00'::timestamp
Can you also show the actual index expression?
Here's a few of the ones I tried:
ag_reach=> CREATE INDEX ON export_hch_encounter_history (CAST("Service_Date" AS date));
ERROR: functions in index expression must be marked IMMUTABLE
ag_reach=> CREATE INDEX ON export_hch_encounter_history (CAST(LEFT("Service_Date",10) AS date));
ERROR: functions in index expression must be marked IMMUTABLE
ag_reach=> CREATE INDEX ON export_hch_encounter_history (CAST("Service_Date"::timestamp AS date));
ERROR: functions in index expression must be marked IMMUTABLE
ag_reach=> CREATE INDEX ON export_hch_encounter_history (("Service_Date"::date));
ERROR: functions in index expression must be marked IMMUTABLE
ag_reach=> CREATE INDEX ON export_hch_encounter_history ((LEFT("Service_Date",10)::date));
ERROR: functions in index expression must be marked IMMUTABLE