/*
 * call-seq:
 *    res.fname( index ) -> String
 *
 * Returns the name of the column corresponding to _index_.
 */
static VALUE
pgresult_fname(VALUE self, VALUE index)
{
        PGresult *result;
        int i = NUM2INT(index);

        result = get_pgresult(self);
        if (i < 0 || i >= PQnfields(result)) {
                rb_raise(rb_eArgError,"invalid field number %d", i);
        }
        return rb_tainted_str_new2(PQfname(result, i));
}