Fix postgres error by setting environment variable