lo_import (PGconn)

    /*
     * call-seq:
     *    conn.lo_import(file) -> PGlarge
     *
     * Import a file to a large object. Returns a PGlarge instance on success. On failure, it raises a PGError exception.
     */
    static VALUE
    pgconn_loimport(obj, filename)
        VALUE obj, filename;
    {
        Oid lo_oid;

        PGconn *conn = get_pgconn(obj);

        Check_Type(filename, T_STRING);

        lo_oid = lo_import(conn, StringValuePtr(filename));
        if (lo_oid == 0) {
            rb_raise(rb_ePGError, PQerrorMessage(conn));
        }
        return pglarge_new(conn, lo_oid, -1);
    }