Re: trying to build immutable function in index - Mailing list pgsql-admin

From Rui DeSousa
Subject Re: trying to build immutable function in index
Date
Msg-id E712B033-4FC4-408A-8794-E3A0AC593D18@crazybean.net
Whole thread Raw
In response to trying to build immutable function in index  (Mark Steben <mark.steben@drivedominion.com>)
List pgsql-admin


On Jun 2, 2020, at 5:42 PM, Mark Steben <mark.steben@drivedominion.com> wrote:

AND value::date >= date_trunc('MONTH'::text, 'now'::text::date - '1 mon'::interval month)

I don’t think value::date is immutable; it will return a different date depending on your timezone. 

Also this is also not immutable:  'now'::text::date - '1 mon'::interval month 

You would have records indexed that should not be indexed the next month basically invalidating itself each month.


pgsql-admin by date:

Previous
From: Mark Steben
Date:
Subject: trying to build immutable function in index
Next
From: "David G. Johnston"
Date:
Subject: Re: trying to build immutable function in index