Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4OWo-0007zj-Ny for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Oct 2017 09:51:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e4OWo-0006MR-6G for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Oct 2017 09:51:14 +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 1e4OW5-00054x-IU for pgsql-bugs@postgresql.org; Tue, 17 Oct 2017 09:50:29 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e4OW2-0005eT-OX for pgsql-bugs@postgresql.org; Tue, 17 Oct 2017 09:50:28 +0000 Received: from [192.168.127.1] (port=16788 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1e4OW0-000IUM-Sm; Tue, 17 Oct 2017 09:50:24 +0000 Received: from [127.0.0.1] (port=16786 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1e4OW0-000Niy-5C; Tue, 17 Oct 2017 09:50:24 +0000 From: Andrew Gierth To: Heikki Linnakangas Cc: Tom Lane , Pg Bugs Subject: Re: Improper const-evaluation of HAVING with grouping sets and subquery pullup In-Reply-To: <87tvyyjg2s.fsf@news-spur.riddles.org.uk> (Andrew Gierth's message of "Tue, 17 Oct 2017 10:16:58 +0100") Message-ID: <87po9mjec0.fsf@news-spur.riddles.org.uk> References: <7dbdcf5c-b5a6-ef89-4958-da212fe10176@iki.fi> <1197.1507820787@sss.pgh.pa.us> <87efq3lq93.fsf@news-spur.riddles.org.uk> <87a80rli2w.fsf@news-spur.riddles.org.uk> <32319.1508163874@sss.pgh.pa.us> <8760bfku2u.fsf@news-spur.riddles.org.uk> <2431.1508166918@sss.pgh.pa.us> <871sm3ktl7.fsf@news-spur.riddles.org.uk> <87tvyyjg2s.fsf@news-spur.riddles.org.uk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Tue, 17 Oct 2017 10:50:24 +0100 MIME-Version: 1.0 Content-Type: text/plain 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 >>>>> "Andrew" == Andrew Gierth writes: Andrew> To my knowledge this is the correct result. (Though neither Andrew> version of the query is legal per the SQL spec; allowing Andrew> expressions and aliases in GROUP BY are nonstandard Andrew> extensions.) And neither Oracle nor MSSQL (at least the versions available on sqlfiddle) allow either query, so there's nothing I can compare against. -- Andrew (irc:RhodiumToad) -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs