Re: [HACKERS] Phantom row from aggregate in self-join in 6.5

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Malcolm Beattie <mbeattie(at)sable(dot)ox(dot)ac(dot)uk>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Phantom row from aggregate in self-join in 6.5
Date: 1999-07-23 03:33:36
Message-ID: 3797E290.4B8E0ABD@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)alumni(dot)caltech(dot)edu
South Pasadena, California

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 1999-07-23 04:21:02 Re: [HACKERS] RFC: remote tables feature
Previous Message Philip Warner 1999-07-23 03:31:08 Re: [HACKERS] Phantom row from aggregate in self-join in 6.5