pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Nested CASE-WHEN scoping
Date: Wed, 25 May 2011 20:27:02 +0300
Message-ID: <4DDD3BE6.7090704@enterprisedb.com> (raw)
In-Reply-To: <23538.1306343493@sss.pgh.pa.us>
References: <4DDCEEB8.50602@enterprisedb.com>
	<5487.1306334876@sss.pgh.pa.us>
	<4DDD35B6.2050203@enterprisedb.com>
	<23538.1306343493@sss.pgh.pa.us>

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



view thread (15+ messages)  latest in thread

Message-ID: <4DDD3BE6.7090704@enterprisedb.com>
Permalink:  ../4DDD3BE6.7090704@enterprisedb.com/
Also on:    postgresql.org/message-id/4DDD3BE6.7090704@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: heikki.linnakangas@enterprisedb.com, tgl@sss.pgh.pa.us
  Subject: Re: Nested CASE-WHEN scoping
  In-Reply-To: <4DDD3BE6.7090704@enterprisedb.com>
  References: <4DDCEEB8.50602@enterprisedb.com> <5487.1306334876@sss.pgh.pa.us> <4DDD35B6.2050203@enterprisedb.com> <23538.1306343493@sss.pgh.pa.us> <4DDD3BE6.7090704@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox