]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Test HAVING condition before computing targetlist of an Aggregate node.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 10 Jul 2004 18:39:44 +0000 (18:39 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 10 Jul 2004 18:39:44 +0000 (18:39 +0000)
commit54affc0921a169559ccbca57fa1b7a9ba09ef813
tree7a4d68ef80173bb55168a527499e058fb6b494ba
parent56442e9fab3c27bf30598867f87f92bf7e15d077
Test HAVING condition before computing targetlist of an Aggregate node.
This is required by SQL spec to avoid failures in cases like
  SELECT sum(win)/sum(lose) FROM ... GROUP BY ... HAVING sum(lose) > 0;
AFAICT we have gotten this wrong since day one.  Kudos to Holger Jakobs
for being the first to notice.
src/backend/executor/nodeAgg.c