Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1beTWJ-0000go-Bl for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Aug 2016 20:51:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1beTWI-0004XB-Up for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Aug 2016 20:51:02 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1beTWI-0004VO-6m for pgsql-bugs@postgresql.org; Mon, 29 Aug 2016 20:51:02 +0000 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1beTWE-0002nK-OH for pgsql-bugs@postgresql.org; Mon, 29 Aug 2016 20:51:00 +0000 Received: by mail-wm0-x233.google.com with SMTP id i5so4298468wmg.0 for ; Mon, 29 Aug 2016 13:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ngs-hr.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=49zorhvtmoBIZVaVEwp/pMIufzexMnjlOLg/B5Ua1LI=; b=cTSs0etTtL8EOvOesu6hV9PiKQ5pIyit+S6JUmcOVW4nTtsK7kFCeUZXJV4m8ouxNi 2XH7s84oaH753bjanpKjqcqTTCOTCqL4UUZSwS/A6oljyQJwzkTeCDAlJ5AHn5Ur1Ntq DHQGTiT7t5apbXOgH6EkNE4Da+JNBJ6erbrBEbKkoEp/zeLR9avCm0pTggqo1d1cmZ/X UYYmTlXJaRijGkvBd3P+icbLbi76YDfD9jHPgrvXIbsU0hptscOiZcKlJORYDvduiRDS CE123ioaweSjC1by3vpUavS1Lil/qX55zu/hycSE3EVAp7P1MwFQp5E7R26qohpI+c04 5ooA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=49zorhvtmoBIZVaVEwp/pMIufzexMnjlOLg/B5Ua1LI=; b=iIEb/0Z38roz9swMEBSsFw3pUVcMPQf+rcXCQ5zbk6MND+yYMAV/RiQPnDlTlaUVvj 0pqsKJPYiyOngFmAx+5FyP5fATwNv0hUrzO5xU+8+dGpAGiWVqFAOrie/Bab+mTQIkmt R0gFs9y45xLkYDFr/nJe5oqiTDZjGYVc8GbJ4UZ53kwqVxZsjS7CEtbgdZxlX6S7y+JG lpV5Skrx/nENUfJjsdbanJvJOTuxoSzg7eEmMDzyipcGls1T4xqciLo4V81NkhVD3rPN auIhU4jEazAjKXSMWLJhEgJZ2+oJ2XMJLCIM3hI0Lgu5U07cucwJZTNIfiA1lIhW/pGP r7jw== X-Gm-Message-State: AE9vXwOXPsYqO7Fv4Izq64HasfGdM3y3XBwYhnyhB3X1V3UkN9f2FOTRMGz3e7UtzFWXHw== X-Received: by 10.28.198.6 with SMTP id w6mr11619644wmf.63.1472503856253; Mon, 29 Aug 2016 13:50:56 -0700 (PDT) Received: from localhost (cpe-188-129-114-70.dynamic.amis.hr. [188.129.114.70]) by smtp.googlemail.com with ESMTPSA id g184sm15251631wme.15.2016.08.29.13.50.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Aug 2016 13:50:55 -0700 (PDT) Date: Mon, 29 Aug 2016 22:53:04 +0200 From: Rikard Pavelic To: David Fetter Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14301: function in case expression called when it should not be Message-ID: <20160829225304.00004ba6@ngs.hr> In-Reply-To: <20160829204419.GF29482@fetter.org> References: <20160829151433.15676.91530@wrigleys.postgresql.org> <20160829204419.GF29482@fetter.org> Organization: N.G.S. X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.30; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) 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 On Mon, 29 Aug 2016 13:44:19 -0700 David Fetter wrote: > This is the expected behavior. You might look into FILTER clauses in > your queries, which might be closer to the behavior you want. Yeah, I realized why it's behaving that way after Tom's answer. I did not write such horrible code, but I worked around it by repeating case when within the sum :) Regards, Rikard -- Rikard Pavelic https://dsl-platform.com/ http://templater.info/ -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs