Re: Common Table Expressions applied; some issues remain - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Common Table Expressions applied; some issues remain
Date
Msg-id 4A1D21E1.1000309@enterprisedb.com
Whole thread Raw
In response to Re: Common Table Expressions applied; some issues remain  (Greg Stark <stark@enterprisedb.com>)
List pgsql-hackers
Greg Stark wrote:
> On Wed, May 27, 2009 at 12:47 AM, Tom Lane <tgl@sss.pgh.pa.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 but the rows will still have the same value for the same
> rows for all references to the CTE which seems like the key property
> to me.

A volatile function could have side-effects, ie. insert rows to another 
table. I would not recommend a design that relies on such behavior, but 
it should be predictable how often the volatile function is run if you 
do that.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Common Table Expressions applied; some issues remain
Next
From: Heikki Linnakangas
Date:
Subject: Re: PostgreSQL Developer meeting minutes up