Re: Calculated view fields (8.1 != 8.2) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Calculated view fields (8.1 != 8.2)
Date
Msg-id 6320.1173203258@sss.pgh.pa.us
Whole thread Raw
In response to Calculated view fields (8.1 != 8.2)  (Gaetano Mendola <mendola@bigfoot.com>)
Responses Re: Calculated view fields (8.1 != 8.2)  (Gaetano Mendola <mendola@bigfoot.com>)
List pgsql-hackers
Gaetano Mendola <mendola@bigfoot.com> writes:
> [ 8.2 evaluates volatile functions in the targetlist of a view ]
> If I mark the function as STABLE or IMMUTABLE then even with version
> 8.2 the function is not evaluated. Is this the intended behavior?

Yes; people complained that we needed to be more careful about the
number of times volatile functions get evaluated.

> I didn't see something about it in the release note.
     <listitem>      <para>       Do not flatten subqueries that contain <literal>volatile</>       functions in their
targetlists (Jaime Casanova)      </para>
 
      <para>       This prevents surprising behavior due to multiple evaluation       of a <literal>volatile</>
function(such as <function>random()</>       or <function>nextval()</>).  It might cause performance       degradation
inthe presence of functions that are unnecessarily       marked as <literal>volatile</>.      </para>     </listitem>
 
        regards, tom lane


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Auto creation of Partitions
Next
From: Gregory Stark
Date:
Subject: Re: GIST and TOAST