Re: [HACKERS] Phantom row from aggregate in self-join in 6.5 - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: [HACKERS] Phantom row from aggregate in self-join in 6.5
Date
Msg-id 3797E290.4B8E0ABD@alumni.caltech.edu
Whole thread Raw
In response to Re: [HACKERS] Phantom row from aggregate in self-join in 6.5  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Phantom row from aggregate in self-join in 6.5
List pgsql-hackers
> >     create table foo (a int);
> >     select t1.a, count(*) from foo t1, foo t2 group by t1.a;
> > I get
> >     a|count
> >     -+-----
> >      |    0
> >     (1 row)
> > instead of zero rows.
> It's not a bug, it's a feature ... or at least there are some around
> here who claim that the behavior is OK.  I think they're wrong, but
> if you want it changed you'll need to cite chapter and verse from the
> SQL92 standard, not just assert that Informix does it differently.

I don't recall which way I argued before (in fact, I don't recall this
particular example), but I do remember arguing (with righteous
conviction) that the query
 select count(*) from foo;

should return a single row containing a zero value. Did we infer from
that some behavior for "group by" (I can't recall any)? istm, at least
today, that the behavior for the group-by is wrong, but we'd better
not change the behavior of my example query...
                  - Thomas

-- 
Thomas Lockhart                lockhart@alumni.caltech.edu
South Pasadena, California


pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Re: [HACKERS] Phantom row from aggregate in self-join in 6.5
Next
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] RFC: remote tables feature