Re: Constraint exclusion can't process simple constant expressions?

From: Brendan Jurd <direvus(at)gmail(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Constraint exclusion can't process simple constant expressions?
Date: 2011-04-21 02:05:29
Message-ID: BANLkTinY9G33LEsnLmWbkR0j3TcxX+HGug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 21 April 2011 11:58, Josh Berkus <josh(at)agliodbs(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2011-04-21 02:13:07 Re: Constraint exclusion can't process simple constant expressions?
Previous Message Josh Berkus 2011-04-21 01:58:56 Re: Constraint exclusion can't process simple constant expressions?