Greg Stark <stark(at)enterprisedb(dot)com> writes:
> On Wed, May 27, 2009 at 12:47 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I'm not too thrilled about that solution because it still eliminates
>> predictability of execution of volatile functions.
> How so? It means the volatile function might only be executed for the
> matching rows
Exactly. If the point of the CTE is to ensure that nextval() is
executed N times, and it actually gets executed less than that,
then we've broken the semantics in a visible way.
regards, tom lane