Re: [PATCH] GROUP BY ALL

From: Andrei Borodin <x4mmm(at)yandex-team(dot)ru>
To: Isaac Morland <isaac(dot)morland(at)gmail(dot)com>
Cc: David G(dot) Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>, David Christensen <david(at)pgguru(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] GROUP BY ALL
Date: 2024-07-23 13:21:55
Message-ID: FA05986F-BF3A-4410-9A30-D8137E431FCE@yandex-team.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

<div class="52245733ac3b195ee6f02a3f4f5dbe50ApplePlainTextBody" dir="auto" style="word-wrap:break-word"><br /><br /><blockquote>On 23 Jul 2024, at 00:40, Isaac Morland &lt;<a href="mailto:isaac(dot)morland(at)gmail(dot)com">isaac(dot)morland(at)gmail(dot)com</a>&gt; wrote:<br /><br />odyssey=&gt; select (uw_term).*, count(*) from uw_term group by uw_term;<br />ERROR:  column "uw_term.term_id" must appear in the GROUP BY clause or be used in an aggregate function<br />LINE 1: select (uw_term).*, count(*) from uw_term group by uw_term;<br /></blockquote><br /><div>AFAIR this problem was solved in my implementation [0]</div><div><br /></div><div><blockquote>On 23 Jul 2024, at 01:29, Tom Lane &lt;<a href="mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us">tgl(at)sss(dot)pgh(dot)pa(dot)us</a>&gt; wrote:<br /><br />(Personally, I'd wonder exactly what ALL is quantified over: the<br />whole output of the FROM clause, or only columns mentioned in the<br />SELECT tlist, or what? And why that choice rather than another?)<br /></blockquote><br /></div><div>I'd like to have GROUP BY AUTO (I also proposed version GROUP BY SURPRISE ME). But I wouldn't like to open pandora box of syntax sugar extensions which may will be incompatible with future standards.</div><div>If we could have extensible grammar - I'd be happy to have a lot of such enhancements. My top 2 are FROM table SELECT column and better GROUP BY.</div><div><br /></div><div><br /></div><div>Best regards, Andrey Borodin.</div><div><br /></div><div><br /></div><div>[0] <a href="https://www.postgresql.org/message-id/flat/CAAhFRxjyTO5BHn9y1oOSEp0TtpTDTTTb7HJBNhTG%2Bi3-hXC0XQ%40mail.gmail.com">https://www.postgresql.org/message-id/flat/CAAhFRxjyTO5BHn9y1oOSEp0TtpTDTTTb7HJBNhTG%2Bi3-hXC0XQ%40mail.gmail.com</a></div></div>

Attachment Content-Type Size
unknown_filename text/html 1.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Christensen 2024-07-23 13:22:55 Re: [PATCH] GROUP BY ALL
Previous Message Heikki Linnakangas 2024-07-23 13:21:53 Re: Comments on Custom RMGRs