Use block form of PGconn to ensure closing of connection