Re: Nested CASE-WHEN scoping - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Nested CASE-WHEN scoping
Date
Msg-id 4DDD3BE6.7090704@enterprisedb.com
Whole thread Raw
In response to Re: Nested CASE-WHEN scoping  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 25.05.2011 20:11, Tom Lane wrote:
> Heikki Linnakangas<heikki.linnakangas@enterprisedb.com>  writes:
>> On 25.05.2011 17:47, Tom Lane wrote:
>>> [ scratches head ... ]  Why does the save/restore in ExecEvalCase not
>>> take care of this?
>
>> The mistake happens during planning, when the SQL function is inlined
>> and pre-evaluated.
>
> Hm.  I'm inclined to think this may be more of a bug in the inlining
> process than anything else.

Well, if you want to get away without the capability to reference 
multiple CaseTestExprs at a time, you'll have to detect the danger and 
abort the inlining process. That's a bit pessimal, although this is a 
pretty artificial case in the first place so maybe we don't care much.

(I'm still going to need more placeholder slots to handle IN and 
BETWEEN. Of course, I can just copy-paste CaseTestExpr into something 
like InTestExpr and BetweenTestExpr, but it seems like it would be good 
to unite all that infrastructure)

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


pgsql-hackers by date:

Previous
From: Vaibhav Kaushal
Date:
Subject: Re: Expression Evaluator used for creating the plan tree / stmt ?
Next
From: Robert Haas
Date:
Subject: Re: tackling full page writes