Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gjnXT-0000tZ-Pr for pgsql-general@arkaria.postgresql.org; Wed, 16 Jan 2019 15:55:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gjnXQ-00030i-9n for pgsql-general@arkaria.postgresql.org; Wed, 16 Jan 2019 15:55:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gjnXP-00030Z-UL for pgsql-general@lists.postgresql.org; Wed, 16 Jan 2019 15:55:32 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gjnXJ-0006jS-Bi for pgsql-general@postgresql.org; Wed, 16 Jan 2019 15:55:30 +0000 Received: from [192.168.127.1] (port=60255 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 1gjnXG-0006Wk-BX; Wed, 16 Jan 2019 15:55:22 +0000 Received: from [127.0.0.1] (port=34027 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1gjnXF-000AfO-Ko; Wed, 16 Jan 2019 15:55:21 +0000 From: Andrew Gierth To: Guillaume Lelarge Cc: PostgreSQL General Subject: Re: Weird behaviour of ROLLUP/GROUPING In-Reply-To: (Guillaume Lelarge's message of "Wed, 16 Jan 2019 13:51:27 +0100") Message-ID: <874la8lhvp.fsf@news-spur.riddles.org.uk> References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Wed, 16 Jan 2019 15:55:21 +0000 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "Guillaume" == Guillaume Lelarge writes: Guillaume> CASE grouping(to_char(b, 'MMYYYY')) Guillaume> ERROR: arguments to GROUPING must be grouping expressions of the Guillaume> associated query level Guillaume> LINE 3: CASE grouping(to_char(b, 'MMYYYY')) WHEN 1 THEN 'some date' ... Guillaume> AFAICT, both queries should behave the same, though their Guillaume> actual behaviours are quite opposite. Working fine for the Guillaume> first, erroring out on the second. Guillaume> Does anyone has any idea what's going on here? Not yet. But I will find out, since it seems to be a bug. -- Andrew (irc:RhodiumToad)