Simple Connection and open query for postgreql