improve postgres config handling