fix pg user/db detection