Tweak pg_exec_query_string so that we close down transaction command before reporting command-complete message for the final command of a query string.  This way, any errors detected during finish_xact_command (such as RI violations) will appear to be part of the final command, rather than coming out after the command is reported complete.  This avoids confusing PQendcopy and other not-overly-bright clients. Per Lee Harr's bug report of 25-Feb-02.
Tweak pg_exec_query_string so that we close down transaction command
before reporting command-complete message for the final command of a
query string.  This way, any errors detected during finish_xact_command
(such as RI violations) will appear to be part of the final command,
rather than coming out after the command is reported complete.  This
avoids confusing PQendcopy and other not-overly-bright clients.
Per Lee Harr's bug report of 25-Feb-02.

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