Re: date_trunc not immutable

2018-12-15 Thread Ravi Krishna
Thanks all.  I forgot the TZ part.

Re: date_trunc not immutable

2018-12-15 Thread Vitaly Burovoy
On 2018-12-15, Adrian Klaver wrote: > On 12/15/18 3:26 PM, Ravi Krishna wrote: >> Version: PG 10.6 on AWS Linux. >> >> I am trying to create an index on function date_trunc('month',timestamp) >> >> PG is complaining that the function must be marked as IMMUTABLE. So I >> assume that date_trunc is

Re: date_trunc not immutable

2018-12-15 Thread Tom Lane
Ravi Krishna writes: > I am trying to create an index on function date_trunc('month',timestamp) > PG is complaining that the function must be marked as IMMUTABLE. The timestamptz version of it is not immutable, because its effects depend on the timezone setting: regression=# set timezone = 'Amer

Re: date_trunc not immutable

2018-12-15 Thread Adrian Klaver
On 12/15/18 3:26 PM, Ravi Krishna wrote: Version: PG 10.6 on AWS Linux. I am trying to create an index on function date_trunc('month',timestamp) PG is complaining that the function must be marked as IMMUTABLE.  So I assume that date_trunc is not marked as immutable. Definition of immutable f

date_trunc not immutable

2018-12-15 Thread Ravi Krishna
Version: PG 10.6 on AWS Linux. I am trying to create an index on function date_trunc('month',timestamp) PG is complaining that the function must be marked as IMMUTABLE. So I assume that date_trunc is not marked as immutable. Definition of immutable from PG documentation ==