Previous patch to mark UNION outputs with common typmod (if any) breaks three-or-more-way UNIONs, as per example from Josh Berkus.  Cause is a fragile assumption that one tlist's entries will exactly match another. Restructure code to make that assumption a little less fragile.
Previous patch to mark UNION outputs with common typmod (if any) breaks
three-or-more-way UNIONs, as per example from Josh Berkus.  Cause is a
fragile assumption that one tlist's entries will exactly match another.
Restructure code to make that assumption a little less fragile.

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