pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Johnston <david.g.johnston@gmail.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #12273: CASE Expression BUG
Date: Thu, 18 Dec 2014 16:14:26 -0500
Message-ID: <4028.1418937266@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwa6BJDf_qu3VJahLXt8NFdXmdaQHS39LiDCbZiifeSzDg@mail.gmail.com>
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>
	<CAKFQuwbPwB92rKdqaXO8qyp2KV_oDKNX3Hzae4XSCYeHZLctag@mail.gmail.com>
	<2065.1418933405@sss.pgh.pa.us>
	<CAKFQuwZSe+Fs1HGdJe0JMd9Qsx7PvT1rWgO+rAjfv+f59UGjog@mail.gmail.com>
	<2652.1418934824@sss.pgh.pa.us>
	<CAKFQuwa6BJDf_qu3VJahLXt8NFdXmdaQHS39LiDCbZiifeSzDg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

David Johnston <david.g.johnston@gmail.com> writes:
> On Thu, Dec 18, 2014 at 1:33 PM, Tom Lane <tgl@sss.pgh.pa.us> 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



view thread (10+ messages)

Message-ID: <4028.1418937266@sss.pgh.pa.us>
Permalink:  ../4028.1418937266@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4028.1418937266@sss.pgh.pa.us

 · 

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com
  Subject: Re: BUG #12273: CASE Expression BUG
  In-Reply-To: <4028.1418937266@sss.pgh.pa.us>
  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> <CAKFQuwbPwB92rKdqaXO8qyp2KV_oDKNX3Hzae4XSCYeHZLctag@mail.gmail.com> <2065.1418933405@sss.pgh.pa.us> <CAKFQuwZSe+Fs1HGdJe0JMd9Qsx7PvT1rWgO+rAjfv+f59UGjog@mail.gmail.com> <2652.1418934824@sss.pgh.pa.us> <CAKFQuwa6BJDf_qu3VJahLXt8NFdXmdaQHS39LiDCbZiifeSzDg@mail.gmail.com> <4028.1418937266@sss.pgh.pa.us>

* 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