Repair for bug #691 --- CREATE TABLE AS column aliases fail to be applied when the select is a UNION (or other set-operation).
Repair for bug #691 --- CREATE TABLE AS column aliases fail to be
applied when the select is a UNION (or other set-operation).

An alternative route to a fix would be to leave analyze.c alone and
change plan_set_operations in prepunion.c to take column names from
the topmost targetlist.  But I am not sure that would work in all
cases.  This patch seems the minimum-risk fix.

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