Fix nasty TRUNCATE bug reported by Darrin Ladd.  RelationTruncateIndexes would close and then re-open rel being truncated.  Depending on the luck of the draw, the re-opened relcache entry might or might not be at the same physical location as before.  Unfortunately, if it wasn't then heap_truncate would crash and burn, because it still had a pointer at the old location.  Fix is to open and then close rel in RelationTruncateIndexes, so that rel's refcount never goes to zero until heap_truncate is done.
Fix nasty TRUNCATE bug reported by Darrin Ladd.  RelationTruncateIndexes
would close and then re-open rel being truncated.  Depending on the
luck of the draw, the re-opened relcache entry might or might not be
at the same physical location as before.  Unfortunately, if it wasn't
then heap_truncate would crash and burn, because it still had a pointer
at the old location.  Fix is to open and then close rel in
RelationTruncateIndexes, so that rel's refcount never goes to zero
until heap_truncate is done.

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