Improve local Postgres instance checking method