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.
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.

jmcatamney/gpdb,ashwinstar/gpdb,adam8157/gpdb,techdragon/Postgres-XL,Postgres-XL/Postgres-XL,lintzc/gpdb,kaknikhil/gpdb,rubikloud/gpdb,50wu/gpdb,janebeckman/gpdb,lisakowen/gpdb,xinzweb/gpdb,chrishajas/gpdb,50wu/gpdb,cjcjameson/gpdb,xinzweb/gpdb,cjcjameson/gpdb,adam8157/gpdb,chrishajas/gpdb,lintzc/gpdb,greenplum-db/gpdb,pavanvd/postgres-xl,zaksoup/gpdb,tpostgres-projects/tPostgres,postmind-net/postgres-xl,arcivanov/postgres-xl,foyzur/gpdb,kmjungersen/PostgresXL,rubikloud/gpdb,chrishajas/gpdb,janebeckman/gpdb,Quikling/gpdb,0x0FFF/gpdb,CraigHarris/gpdb,atris/gpdb,chrishajas/gpdb,lintzc/gpdb,randomtask1155/gpdb,rvs/gpdb,rvs/gpdb,cjcjameson/gpdb,randomtask1155/gpdb,Chibin/gpdb,ovr/postgres-xl,Quikling/gpdb,janebeckman/gpdb,atris/gpdb,rubikloud/gpdb,kmjungersen/PostgresXL,randomtask1155/gpdb,adam8157/gpdb,CraigHarris/gpdb,xinzweb/gpdb,Chibin/gpdb,kmjungersen/PostgresXL,edespino/gpdb,lpetrov-pivotal/gpdb,royc1/gpdb,CraigHarris/gpdb,CraigHarris/gpdb,jmcatamney/gpdb,royc1/gpdb,rvs/gpdb,edespino/gpdb,tangp3/gpdb,lpetrov-pivotal/gpdb,janebeckman/gpdb,50wu/gpdb,postmind-net/postgres-xl,xinzweb/gpdb,zaksoup/gpdb,lpetrov-pivotal/gpdb,0x0FFF/gpdb,ashwinstar/gpdb,oberstet/postgres-xl,ashwinstar/gpdb,greenplum-db/gpdb,atris/gpdb,royc1/gpdb,Quikling/gpdb,zaksoup/gpdb,xuegang/gpdb,royc1/gpdb,CraigHarris/gpdb,0x0FFF/gpdb,xuegang/gpdb,atris/gpdb,kaknikhil/gpdb,ovr/postgres-xl,greenplum-db/gpdb,ahachete/gpdb,oberstet/postgres-xl,ahachete/gpdb,lisakowen/gpdb,CraigHarris/gpdb,Chibin/gpdb,Quikling/gpdb,chrishajas/gpdb,kaknikhil/gpdb,tangp3/gpdb,ahachete/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,atris/gpdb,greenplum-db/gpdb,zaksoup/gpdb,tangp3/gpdb,pavanvd/postgres-xl,lpetrov-pivotal/gpdb,ovr/postgres-xl,snaga/postgres-xl,lpetrov-pivotal/gpdb,tpostgres-projects/tPostgres,royc1/gpdb,lpetrov-pivotal/gpdb,CraigHarris/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,oberstet/postgres-xl,randomtask1155/gpdb,50wu/gpdb,foyzur/gpdb,rubikloud/gpdb,yuanzhao/gpdb,atris/gpdb,randomtask1155/gpdb,lintzc/gpdb,50wu/gpdb,zaksoup/gpdb,ahachete/gpdb,atris/gpdb,edespino/gpdb,CraigHarris/gpdb,greenplum-db/gpdb,lintzc/gpdb,yuanzhao/gpdb,arcivanov/postgres-xl,snaga/postgres-xl,oberstet/postgres-xl,yuanzhao/gpdb,rubikloud/gpdb,xuegang/gpdb,snaga/postgres-xl,atris/gpdb,edespino/gpdb,ahachete/gpdb,tangp3/gpdb,pavanvd/postgres-xl,xuegang/gpdb,foyzur/gpdb,pavanvd/postgres-xl,postmind-net/postgres-xl,rvs/gpdb,rvs/gpdb,xinzweb/gpdb,Postgres-XL/Postgres-XL,xuegang/gpdb,lintzc/gpdb,Chibin/gpdb,janebeckman/gpdb,cjcjameson/gpdb,lisakowen/gpdb,techdragon/Postgres-XL,randomtask1155/gpdb,kaknikhil/gpdb,rvs/gpdb,edespino/gpdb,Quikling/gpdb,yazun/postgres-xl,50wu/gpdb,rubikloud/gpdb,lisakowen/gpdb,lintzc/gpdb,adam8157/gpdb,zeroae/postgres-xl,zeroae/postgres-xl,adam8157/gpdb,yuanzhao/gpdb,50wu/gpdb,edespino/gpdb,Postgres-XL/Postgres-XL,zeroae/postgres-xl,ovr/postgres-xl,janebeckman/gpdb,lisakowen/gpdb,zaksoup/gpdb,xuegang/gpdb,edespino/gpdb,Chibin/gpdb,ovr/postgres-xl,ashwinstar/gpdb,arcivanov/postgres-xl,foyzur/gpdb,oberstet/postgres-xl,chrishajas/gpdb,royc1/gpdb,yazun/postgres-xl,Postgres-XL/Postgres-XL,foyzur/gpdb,snaga/postgres-xl,Quikling/gpdb,CraigHarris/gpdb,Postgres-XL/Postgres-XL,lisakowen/gpdb,edespino/gpdb,pavanvd/postgres-xl,cjcjameson/gpdb,yuanzhao/gpdb,zeroae/postgres-xl,0x0FFF/gpdb,kmjungersen/PostgresXL,greenplum-db/gpdb,janebeckman/gpdb,Chibin/gpdb,arcivanov/postgres-xl,kaknikhil/gpdb,chrishajas/gpdb,snaga/postgres-xl,cjcjameson/gpdb,rubikloud/gpdb,royc1/gpdb,Quikling/gpdb,xinzweb/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,janebeckman/gpdb,adam8157/gpdb,royc1/gpdb,postmind-net/postgres-xl,Quikling/gpdb,janebeckman/gpdb,Quikling/gpdb,ashwinstar/gpdb,xuegang/gpdb,lisakowen/gpdb,techdragon/Postgres-XL,chrishajas/gpdb,0x0FFF/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,cjcjameson/gpdb,adam8157/gpdb,tpostgres-projects/tPostgres,xinzweb/gpdb,tangp3/gpdb,postmind-net/postgres-xl,lpetrov-pivotal/gpdb,tangp3/gpdb,lintzc/gpdb,arcivanov/postgres-xl,arcivanov/postgres-xl,janebeckman/gpdb,Chibin/gpdb,zeroae/postgres-xl,edespino/gpdb,jmcatamney/gpdb,kaknikhil/gpdb,randomtask1155/gpdb,kaknikhil/gpdb,yuanzhao/gpdb,kaknikhil/gpdb,ashwinstar/gpdb,xuegang/gpdb,0x0FFF/gpdb,edespino/gpdb,tangp3/gpdb,foyzur/gpdb,yazun/postgres-xl,foyzur/gpdb,lintzc/gpdb,0x0FFF/gpdb,kmjungersen/PostgresXL,tpostgres-projects/tPostgres,zaksoup/gpdb,50wu/gpdb,Chibin/gpdb,jmcatamney/gpdb,Chibin/gpdb,Quikling/gpdb,lisakowen/gpdb,cjcjameson/gpdb,yazun/postgres-xl,rvs/gpdb,rvs/gpdb,tpostgres-projects/tPostgres,randomtask1155/gpdb,ashwinstar/gpdb,ahachete/gpdb,tangp3/gpdb,yuanzhao/gpdb,rubikloud/gpdb,0x0FFF/gpdb,ahachete/gpdb,techdragon/Postgres-XL,kaknikhil/gpdb,yuanzhao/gpdb,yazun/postgres-xl,Chibin/gpdb,lpetrov-pivotal/gpdb,jmcatamney/gpdb,cjcjameson/gpdb,rvs/gpdb,adam8157/gpdb,ahachete/gpdb,techdragon/Postgres-XL,jmcatamney/gpdb,xuegang/gpdb,greenplum-db/gpdb,xinzweb/gpdb,rvs/gpdb,foyzur/gpdb,zaksoup/gpdb