Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p782S-0004ob-PZ for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Dec 2022 04:46:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p782R-0000ti-Ev for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Dec 2022 04:46:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p782R-0000s6-3s for pgsql-hackers@lists.postgresql.org; Mon, 19 Dec 2022 04:46:07 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p782K-0001LG-SY for pgsql-hackers@postgresql.org; Mon, 19 Dec 2022 04:46:06 +0000 Received: by mail-ed1-x536.google.com with SMTP id r26so11227970edc.10 for ; Sun, 18 Dec 2022 20:46:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CPJS8wj9vNMveBGInxmJHlkbwM5/4pWpEmltQCAYYKk=; b=M3eVSkerYKAYF8yfAYGY49jP0hSLUehr0NM7QyY6Xi6Q8GNvpA3IeaYaaG2tvKLPfb DGhS/8gKVwzGqa1EbYFn9KD1dDdW69ZIg2KhZUjCjlw+9WT/QXMJeZtDpgn8I0Lu50ds SJKxZPu//wj9XthTY0kqYwgeGOXpZw25eMf0CHP5Y7YLWePhe0Yem0ak4AofNVQ+8CaM i+Iqfh4udTBAWeOw4cmxsZN8HSer44jtjRxzYvlCWAirNWYsvnNo3YvY/rpp1CI1Zj/p am79oGQwFs5l1ziWRx7WBxcMtUww7SeB88pjY6T5DVWobxPFNlY20RBw4mhmkUAt3pqg /E6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CPJS8wj9vNMveBGInxmJHlkbwM5/4pWpEmltQCAYYKk=; b=Y+WrscBhEp6nfwY4mALmB/HiBMB2WEaBBgw0lO9PYAXhO0AgAz72B8PGEQtYps8Zy0 hvbq1g+yJjqsn0QTxRgjlYHUDx59LQNjPzD0MQeMKi6gyn09Mbsxf1eaaf6UnX7xb52r jn8ntG7SRuARo7lXjpH8Sufz8eETfCVB1c4p/ZYIvGxq+FRxfm5DpBjQoMjbccdkgZsj Yc05MJRypbquXeYUMrMl8TPuIKTt1LctdCSE0SiC97mv9C4ivScR7EXRj3TRpQ4dUzq5 dzwudi+VB2HzaOrvxg98bPJN1TZxoMtqlvnQoHZ+p3VQ+dezVk2FrD03SWtbYjBdLINg WKpg== X-Gm-Message-State: ANoB5pmJ2F+8UQyZSlwFg+pNtkpahcNQnuIGYGU6Oq1qRK52Isyq2t4U 1lNTMxrOHyX6r9Ix3o++9LUc6pXSe5BAUg9BUL0= X-Google-Smtp-Source: AA0mqf7pJ7DI+0JaOYAsB9cJOnIjrn/HyeYPnpt6IPZtWU2FpQSz70CRKUZPYVKAt1dJKxaaSo3Gb8j7pG1DcAf9GnI= X-Received: by 2002:a05:6402:b11:b0:46b:c86a:6411 with SMTP id bm17-20020a0564020b1100b0046bc86a6411mr33593999edb.417.1671425158818; Sun, 18 Dec 2022 20:45:58 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a98:9f8e:0:b0:18f:2c3:cd60 with HTTP; Sun, 18 Dec 2022 20:45:58 -0800 (PST) In-Reply-To: <835590.1671424214@sss.pgh.pa.us> References: <835590.1671424214@sss.pgh.pa.us> From: "David G. Johnston" Date: Sun, 18 Dec 2022 21:45:58 -0700 Message-ID: Subject: Re: GROUP BY ALL To: Tom Lane Cc: Andrey Borodin , pgsql-hackers Content-Type: multipart/alternative; boundary="000000000000dc308a05f026fe13" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000dc308a05f026fe13 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sunday, December 18, 2022, Tom Lane wrote: > Andrey Borodin writes: > > I saw a thread in a social network[0] about GROUP BY ALL. The idea seem= s > useful. > > Isn't that just a nonstandard spelling of SELECT DISTINCT? > > What would happen if there are aggregate functions in the tlist? > I'm not especially on board with "ALL" meaning "ALL (oh, but not > aggregates)". > > IIUC some systems treat any non-aggregated column as an implicit group by column. This proposal is an explicit way to enable that implicit behavior in PostgreSQL. It is, as you note, an odd meaning for the word ALL. We tend to not accept non-standard usability syntax extensions even if others systems implement them. I don=E2=80=99t see this one ending up bein= g an exception=E2=80=A6 David J. --000000000000dc308a05f026fe13 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sunday, December 18, 2022, Tom Lane <tgl@sss.pgh.pa.us> wrote:
And= rey Borodin <amborodin86@gmail.= com> writes:
> I saw a thread in a social network[0] about GROUP BY ALL. The idea see= ms useful.

Isn't that just a nonstandard spelling of SELECT DISTINCT?

What would happen if there are aggregate functions in the tlist?
I'm not especially on board with "ALL" meaning "ALL (oh,= but not
aggregates)".


IIUC some systems treat any non-aggregated= column as an implicit group by column.=C2=A0 This proposal is an explicit = way to enable that implicit behavior in PostgreSQL.=C2=A0 It is, as you not= e, an odd meaning for the word ALL.

We tend to not= accept non-standard usability syntax extensions even if others systems imp= lement them.=C2=A0 I don=E2=80=99t see this one ending up being an exceptio= n=E2=80=A6

David J.

--000000000000dc308a05f026fe13--