each (PGresult)

    /*
     * call-seq:
     *    res.each{ |tuple| ... }
     *
     * Invokes block for each tuple in the result set.
     */
    static VALUE
    pgresult_each(VALUE self)
    {
            PGresult *result = get_pgresult(self);
            int tuple_num;

            for(tuple_num = 0; tuple_num < PQntuples(result); tuple_num++) {
                    rb_yield(pgresult_aref(self, INT2NUM(tuple_num)));
            }
            return self;
    }