Re: Wrong results with grouping sets

Richard Guo <guofenglinux@gmail.com>

From: Richard Guo <guofenglinux@gmail.com>
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2024-07-10T01:22:54Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Remove the RTE_GROUP RTE if we drop the groupClause

  2. Mark expressions nullable by grouping sets

  3. Introduce an RTE for the grouping step

Attachments

On Sat, Jul 6, 2024 at 9:26 AM Richard Guo <guofenglinux@gmail.com> wrote:
> On Thu, Jul 4, 2024 at 6:02 PM Ashutosh Bapat
> <ashutosh.bapat.oss@gmail.com> wrote:
> > I don't have any specific thoughts on backpatching, but I have started
> > reviewing the patches.

> Thanks for reviewing this patchset!

Here is an updated version of this patchset.  I've added some comments
according to the review feedback, and also tweaked the commit messages
a bit more.

Additionally, I've made a change to only add the new RTE_GROUP RTE
when there are acceptable GROUP BY expressions.  This allows us to
skip all the trouble of doing this for queries without GROUP BY
clauses.

Thanks
Richard