COPY performance improvements.  Avoid calling CopyGetData for each input character, tighten the inner loops of CopyReadLine and CopyReadAttribute, arrange to parse out all the attributes of a line in just one call instead of one CopyReadAttribute call per attribute, be smarter about which client encodings require slow pg_encoding_mblen() loops.  Also, clean up the mishmash of static variables and overly-long parameter lists in favor of passing around a single CopyState struct containing all the state data. Original patch by Alon Goldshuv, reworked by Tom Lane.
COPY performance improvements.  Avoid calling CopyGetData for each input
character, tighten the inner loops of CopyReadLine and CopyReadAttribute,
arrange to parse out all the attributes of a line in just one call instead
of one CopyReadAttribute call per attribute, be smarter about which client
encodings require slow pg_encoding_mblen() loops.  Also, clean up the
mishmash of static variables and overly-long parameter lists in favor of
passing around a single CopyState struct containing all the state data.
Original patch by Alon Goldshuv, reworked by Tom Lane.

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