Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1iP2-0006j6-On for pgsql-bugs@arkaria.postgresql.org; Thu, 18 Dec 2014 21:14:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y1iP2-00036H-93 for pgsql-bugs@arkaria.postgresql.org; Thu, 18 Dec 2014 21:14:32 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y1iP1-000364-HT for pgsql-bugs@postgresql.org; Thu, 18 Dec 2014 21:14:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y1iOy-0005rO-P1 for pgsql-bugs@postgresql.org; Thu, 18 Dec 2014 21:14:29 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id sBILEQpx004029; Thu, 18 Dec 2014 16:14:26 -0500 From: Tom Lane To: David Johnston cc: "pgsql-bugs@postgresql.org" Subject: Re: BUG #12273: CASE Expression BUG In-reply-to: References: <20141218144436.1237.96696@wrigleys.postgresql.org> <16630.1418918898@sss.pgh.pa.us> <1418921627518-5831325.post@n5.nabble.com> <17992.1418922882@sss.pgh.pa.us> <2065.1418933405@sss.pgh.pa.us> <2652.1418934824@sss.pgh.pa.us> Comments: In-reply-to David Johnston message dated "Thu, 18 Dec 2014 14:12:05 -0700" Date: Thu, 18 Dec 2014 16:14:26 -0500 Message-ID: <4028.1418937266@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org David Johnston writes: > On Thu, Dec 18, 2014 at 1:33 PM, Tom Lane wrote: >> That's why that isn't the example ;-). In this case, since the WHEN is a >> constant, the constant-expression simplifier itself figures out that it >> can throw away the THEN expression and replace the whole CASE with the >> ELSE expression. So it doesn't bother const-simplifying the THEN, hence >> no error. > ​Is the example with the "WITH" CTE too involved to use instead?​ Doesn't seem like it really adds anything. >> Meh. The same principle applies in other languages too, so I don't think >> your wording is an improvement. > ​Your's just didn't read that well to me...though the overall content was > good. Maybe drop "Thus" and just lead with "Within PL/pgSQL functions, for > example, using an IF [...]" OK. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs