lo_creat (PGconn)

    /*
     * call-seq:
     *    conn.lo_creat( [mode] ) -> Fixnum
     *
     * Creates a large object with mode _mode_. Returns a large object Oid.
     * On failure, it raises PGError exception.
     */
    static VALUE
    pgconn_locreat(int argc, VALUE *argv, VALUE self)
    {
            Oid lo_oid;
            int mode;
            VALUE nmode;
            PGconn *conn = get_pgconn(self);

            if (rb_scan_args(argc, argv, "01", &nmode) == 0)
                    mode = INV_READ;
            else
                    mode = NUM2INT(nmode);

            lo_oid = lo_creat(conn, mode);
            if (lo_oid == 0)
                    rb_raise(rb_ePGError, "lo_creat failed");

            return INT2FIX(lo_oid);
    }