pg_fetch_array fix

need null to loop throw
wrapper now flexible

call the global kga and get the value to the private var