Export locale variables when forking a postmaster. (#437)
Export locale variables when forking a postmaster. (#437)

Avoid "postmaster became multithreaded during startup" error on OS X built with --enable-nls (default for petere/homebrew).

The issue is that on OS X the libintl that replaces setlocale() spawns a thread when it needs to detect the current locale. Setting the LC_ and LANG variables prevents this, but we don't propagate them to the fork.

See: b7840ef8caa8d6e355253b445124038821005e5d@tornado.leadboat.com for an additional explanation of the original Postgres behavior.
zalando/patroni,zalando/patroni