Re: Requesting advanced Group By support

2018-10-15 Thread Peter Eisentraut
On 10/10/2018 19:59, Andres Freund wrote: > Isn't the spec compliant thing that's missing dealing with unique not null? I don't think that's what the original poster complained about, but you are right that it's a known missing part. The reason it's missing is that we can't record dependencies on

Re: Requesting advanced Group By support

2018-10-12 Thread Robert Haas
On Wed, Oct 10, 2018 at 1:50 PM Tom Lane wrote: > It fails in cases where the data type > considers distinguishable values to be "equal", as for example zero vs. > minus zero in IEEE floats, or numeric values with varying numbers of > trailing zeroes, or citext, etc. So for example if the sno col

Re: Requesting advanced Group By support

2018-10-10 Thread Tom Lane
Andres Freund writes: > On October 10, 2018 10:37:40 AM PDT, Tom Lane wrote: >> Tomas Vondra writes: >>> So, which part of this supposedly does not work in PostgreSQL? >> The part where it infers that b.sno is unique based solely on it having >> been equated to a.sno. > Isn't the spec complian

Re: Requesting advanced Group By support

2018-10-10 Thread Andres Freund
Hi, On October 10, 2018 10:37:40 AM PDT, Tom Lane wrote: >Tomas Vondra writes: >> On 10/09/2018 03:10 PM, Arun Kumar wrote: >>> *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 ke

Sv: Re: Requesting advanced Group By support

2018-10-10 Thread Andreas Joseph Krogh
På onsdag 10. oktober 2018 kl. 18:46:15, skrev Tomas Vondra < tomas.von...@2ndquadrant.com >: Hi, On 10/09/2018 03:10 PM, Arun Kumar wrote: > Hi, >  From MySQL 5.7, It supports SQL standard 99 and implements the feature > such functional dependent on the GR

Re: Requesting advanced Group By support

2018-10-10 Thread Tom Lane
I wrote: > Tomas Vondra writes: >> So, which part of this supposedly does not work in PostgreSQL? > The part where it infers that b.sno is unique based solely on it having > been equated to a.sno. Oh, wait a second: such an inference is actually *wrong* in the general case, or at least underdete

Re: Requesting advanced Group By support

2018-10-10 Thread Tom Lane
Tomas Vondra writes: > On 10/09/2018 03:10 PM, Arun Kumar wrote: >> *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 identif

Re: Requesting advanced Group By support

2018-10-10 Thread Tomas Vondra
Hi, On 10/09/2018 03:10 PM, Arun Kumar wrote: 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 GRO