Revert gpdb-refactored snippet to upstream version.
Revert gpdb-refactored snippet to upstream version.

While it might make sense to extract this duplicated code to a function,
let's rather avoid the difference from upstream.

Chibin/gpdb,xinzweb/gpdb,Chibin/gpdb,edespino/gpdb,greenplum-db/gpdb,lisakowen/gpdb,Quikling/gpdb,lintzc/gpdb,jmcatamney/gpdb,Chibin/gpdb,lisakowen/gpdb,CraigHarris/gpdb,CraigHarris/gpdb,greenplum-db/gpdb,CraigHarris/gpdb,ashwinstar/gpdb,adam8157/gpdb,Chibin/gpdb,janebeckman/gpdb,ashwinstar/gpdb,janebeckman/gpdb,xuegang/gpdb,xinzweb/gpdb,yuanzhao/gpdb,kaknikhil/gpdb,ashwinstar/gpdb,adam8157/gpdb,kaknikhil/gpdb,janebeckman/gpdb,adam8157/gpdb,edespino/gpdb,xinzweb/gpdb,lisakowen/gpdb,cjcjameson/gpdb,kaknikhil/gpdb,rvs/gpdb,ashwinstar/gpdb,lisakowen/gpdb,lintzc/gpdb,xuegang/gpdb,adam8157/gpdb,xinzweb/gpdb,greenplum-db/gpdb,cjcjameson/gpdb,yuanzhao/gpdb,edespino/gpdb,yuanzhao/gpdb,kaknikhil/gpdb,50wu/gpdb,xuegang/gpdb,yuanzhao/gpdb,Chibin/gpdb,cjcjameson/gpdb,Quikling/gpdb,CraigHarris/gpdb,kaknikhil/gpdb,rvs/gpdb,lisakowen/gpdb,CraigHarris/gpdb,kaknikhil/gpdb,edespino/gpdb,xinzweb/gpdb,rvs/gpdb,edespino/gpdb,rvs/gpdb,50wu/gpdb,kaknikhil/gpdb,CraigHarris/gpdb,adam8157/gpdb,yuanzhao/gpdb,adam8157/gpdb,kaknikhil/gpdb,Quikling/gpdb,xuegang/gpdb,cjcjameson/gpdb,cjcjameson/gpdb,lintzc/gpdb,xinzweb/gpdb,Quikling/gpdb,edespino/gpdb,rvs/gpdb,rvs/gpdb,jmcatamney/gpdb,xuegang/gpdb,janebeckman/gpdb,cjcjameson/gpdb,janebeckman/gpdb,edespino/gpdb,Quikling/gpdb,rvs/gpdb,xuegang/gpdb,adam8157/gpdb,xuegang/gpdb,CraigHarris/gpdb,jmcatamney/gpdb,yuanzhao/gpdb,lintzc/gpdb,ashwinstar/gpdb,xuegang/gpdb,jmcatamney/gpdb,kaknikhil/gpdb,yuanzhao/gpdb,Chibin/gpdb,Quikling/gpdb,50wu/gpdb,greenplum-db/gpdb,janebeckman/gpdb,cjcjameson/gpdb,jmcatamney/gpdb,yuanzhao/gpdb,xinzweb/gpdb,jmcatamney/gpdb,janebeckman/gpdb,cjcjameson/gpdb,50wu/gpdb,Quikling/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,lintzc/gpdb,Chibin/gpdb,rvs/gpdb,50wu/gpdb,kaknikhil/gpdb,lisakowen/gpdb,cjcjameson/gpdb,yuanzhao/gpdb,cjcjameson/gpdb,edespino/gpdb,50wu/gpdb,lintzc/gpdb,janebeckman/gpdb,Quikling/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,edespino/gpdb,CraigHarris/gpdb,greenplum-db/gpdb,Quikling/gpdb,50wu/gpdb,50wu/gpdb,greenplum-db/gpdb,rvs/gpdb,xinzweb/gpdb,Chibin/gpdb,ashwinstar/gpdb,janebeckman/gpdb,Chibin/gpdb,Chibin/gpdb,greenplum-db/gpdb,lintzc/gpdb,CraigHarris/gpdb,lisakowen/gpdb,Quikling/gpdb,xuegang/gpdb,lisakowen/gpdb,lintzc/gpdb,edespino/gpdb,yuanzhao/gpdb,greenplum-db/gpdb,janebeckman/gpdb,rvs/gpdb,adam8157/gpdb,lintzc/gpdb