fformat (PGresult)

    /*
     * call-seq:
     *    res.fformat( column_number ) -> Fixnum
     *
     * Returns the format (0 for text, 1 for binary) of column
     * _column_number_.
     *
     * Raises ArgumentError if _column_number_ is out of range.
     */
    static VALUE
    pgresult_fformat(VALUE self, VALUE column_number)
    {
            PGresult *result = get_pgresult(self);
            int fnumber = NUM2INT(column_number);
            if (fnumber >= PQnfields(result)) {
                    rb_raise(rb_eArgError, "Column number is out of range: %d",
                            fnumber);
            }
            return INT2FIX(PQfformat(result, fnumber));
    }