Requesting advanced Group By support

From: Arun Kumar <vak(dot)king(at)outlook(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Requesting advanced Group By support
Date: 2018-10-09 13:10:20
Message-ID: TY2PR02MB340840AB9739C5A4013E4B3B85E60@TY2PR02MB3408.apcprd02.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
From MySQL 5.7, It supports SQL standard 99 and implements the feature such functional dependent on the GROUP By columns, i.e., it detects the non-aggregate columns which are functionally dependent on the GROUP BY columns (not included in GROUP BY) and then executes the query without error.
For example,

SELECT a.sno,b.sno,a.name,b.location FROM Name AS a JOIN Location AS b ON a.sno=b.sno GROUP BY a.sno,b.location

In this case, a.sno is a primary key so no need to include a.name in GROUP By as it would be identified by the primary key and then for b.sno which is again equated with a.sno (primary key) so no need to add this as well but for b.location, we need to add it in GROUP BY or we should use any aggregate function over this column to avoid error. For more info, please check on the below link https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html
Is there any plans on supporting this in Postgres in future versions ?

Thank You,
Arun Kumar

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2018-10-09 13:38:18 Re: Some incorrect comments and out-dated README from run-time pruning
Previous Message Daniel Gustafsson 2018-10-09 13:09:25 Support custom socket directory in pg_upgrade