/*
 *  call-seq:
 *     res.field_values( field )   -> array
 *
 *  Returns an Array of the values from the given _field_ of each tuple in the result.
 *
 */
static VALUE
pgresult_field_values( VALUE self, VALUE field )
{
    PGresult *result = get_pgresult( self );
    const char *fieldname = RSTRING_PTR( field );
    int fnum = PQfnumber( result, fieldname );

    if ( fnum < 0 )
        rb_raise( rb_eIndexError, "no such field '%s' in result", fieldname );
    
    return make_column_result_array( self, fnum );
}