This is actually more of a fundamental problem with mdtruncate.  It looks like someone just didn't add support for multiple segments for truncation.
This is actually more of a fundamental problem with mdtruncate.  It
looks
like someone just didn't add support for multiple segments for
truncation.

The following patch seems to do the right thing, for me at least.
It passed my tests, my data looks right(no data that shouldn't be in
there) and regression is ok.

Ole Gjerde

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