Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WHzAU-0002mo-29 for pgsql-sql@arkaria.postgresql.org; Mon, 24 Feb 2014 17:18:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WHzAT-0001MI-I1 for pgsql-sql@arkaria.postgresql.org; Mon, 24 Feb 2014 17:18:13 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WHzAS-0001L0-BU for pgsql-sql@postgresql.org; Mon, 24 Feb 2014 17:18:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WHzAQ-0007f2-61 for pgsql-sql@postgresql.org; Mon, 24 Feb 2014 17:18:11 +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 s1OHI9q3003755; Mon, 24 Feb 2014 12:18:09 -0500 From: Tom Lane To: David Johnston cc: pgsql-sql@postgresql.org Subject: Re: Postgres behavior - Conditional statements In-reply-to: <1393260479026-5793317.post@n5.nabble.com> References: <1905.1393257750@sss.pgh.pa.us> <1393260479026-5793317.post@n5.nabble.com> Comments: In-reply-to David Johnston message dated "Mon, 24 Feb 2014 08:47:59 -0800" Date: Mon, 24 Feb 2014 12:18:09 -0500 Message-ID: <3754.1393262289@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-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org David Johnston writes: > Tom Lane-2 wrote >> The behavior of CASE didn't change, but the behavior of the sub-select >> did. > CASE should be treated just like a function and the name of the function > should be returned. Arbitrarily picking the "else" branch to obtain the > name of the result column seems somehow wrong. [ shrug... ] It's acted like that since roughly the late bronze age; or to be more specific, since commit 2b189aa9537f7b4a of 1998-12-13. Given the lack of previous complaints, it's going to take a lot more than one man's opinion to change it. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql