Re: Constraint exclusion can't process simple constant expressions? - Mailing list pgsql-performance

From Brendan Jurd
Subject Re: Constraint exclusion can't process simple constant expressions?
Date
Msg-id BANLkTinY9G33LEsnLmWbkR0j3TcxX+HGug@mail.gmail.com
Whole thread Raw
In response to Re: Constraint exclusion can't process simple constant expressions?  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Constraint exclusion can't process simple constant expressions?
Re: Constraint exclusion can't process simple constant expressions?
List pgsql-performance
On 21 April 2011 11:58, Josh Berkus <josh@agliodbs.com> wrote:
>> timestamptz + interval is not immutable --- in fact, the particular
>> example you give (ts + '1 day') is certainly dependent on timezone
>> setting.
>
> Why not?  Given that the time zone will be the same for both the
> timestamptz and the interval, how would the result not be immutable?
>

"IMMUTABLE indicates that the function cannot modify the database and
always returns the same result when given the same argument values"

Emphasis on "always".  If the result of the function, given the same
argument values, can be different after a SET, then it doesn't qualify
for immutability.  At least, that's my understanding.

Cheers,
BJ

pgsql-performance by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Constraint exclusion can't process simple constant expressions?
Next
From: Josh Berkus
Date:
Subject: Re: Constraint exclusion can't process simple constant expressions?