Properly sudo'ing psql command in postgres check