Search Postgresql Archives

Re: Immutable way to cast timestamp TEXT to DATE? (for index)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 4, 2019 at 2:27 PM Adrian Klaver <adrian.klaver@xxxxxxxxxxx> wrote:
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


-- 
AGENCY Software  
A Free Software data system
By and for non-profits
(253) 245-3801

learn more about AGENCY or
follow the discussion.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux