Always set the six locale category environment variables in main().
Always set the six locale category environment variables in main().

Typical server invocations already achieved that.  Invalid locale
settings in the initial postmaster environment interfered, as could
malloc() failure.  Setting "LC_MESSAGES=pt_BR.utf8 LC_ALL=invalid" in
the postmaster environment will now choose C-locale messages, not
Brazilian Portuguese messages.  Most localized programs, including all
PostgreSQL frontend executables, do likewise.  Users are unlikely to
observe changes involving locale categories other than LC_MESSAGES.
CheckMyDatabase() ensures that we successfully set LC_COLLATE and
LC_CTYPE; main() sets the remaining three categories to locale "C",
which almost cannot fail.  Back-patch to 9.0 (all supported versions).

ashwinstar/gpdb,ashwinstar/gpdb,xinzweb/gpdb,50wu/gpdb,adam8157/gpdb,ashwinstar/gpdb,xinzweb/gpdb,lisakowen/gpdb,lisakowen/gpdb,xinzweb/gpdb,ashwinstar/gpdb,50wu/gpdb,50wu/gpdb,adam8157/gpdb,lisakowen/gpdb,lisakowen/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,50wu/gpdb,50wu/gpdb,lisakowen/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,adam8157/gpdb,50wu/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,adam8157/gpdb,50wu/gpdb,50wu/gpdb,adam8157/gpdb,adam8157/gpdb,jmcatamney/gpdb,adam8157/gpdb,lisakowen/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,xinzweb/gpdb,adam8157/gpdb,lisakowen/gpdb,xinzweb/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,xinzweb/gpdb,greenplum-db/gpdb,xinzweb/gpdb,lisakowen/gpdb,xinzweb/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,ashwinstar/gpdb