On this page
The MOLT Schema Conversion Tool and MOLT Fetch can be used to automatically generate schema for a CockroachDB cluster. By default, types are mapped from the source database to CockroachDB as follows:
- PostgreSQL types are mapped to existing CockroachDB types that have the same
OID. The following MySQL types are mapped to corresponding CockroachDB types:
MySQL type CockroachDB type Notes CHAR,CHARACTER,VARCHAR,NCHAR,NVARCHARVARCHARVarying-length string; raises warning if BYTE semantics used TINYTEXT,TEXT,MEDIUMTEXT,LONGTEXTSTRINGUnlimited-length string GEOMETRYGEOMETRYSpatial type (PostGIS-style) LINESTRINGLINESTRINGSpatial type (PostGIS-style) POINTPOINTSpatial type (PostGIS-style) POLYGONPOLYGONSpatial type (PostGIS-style) MULTIPOINTMULTIPOINTSpatial type (PostGIS-style) MULTILINESTRINGMULTILINESTRINGSpatial type (PostGIS-style) MULTIPOLYGONMULTIPOLYGONSpatial type (PostGIS-style) GEOMETRYCOLLECTION,GEOMCOLLECTIONGEOMETRYCOLLECTIONSpatial type (PostGIS-style) JSONJSONBCRDB's native JSON format TINYINT,INT1INT22-byte integer BLOBBYTESBinary data SMALLINT,INT2INT22-byte integer MEDIUMINT,INT,INTEGER,INT4INT44-byte integer BIGINT,INT8INT8-byte integer FLOATFLOAT432-bit float DOUBLEFLOAT64-bit float DECIMAL,NUMERIC,REALDECIMALValidates scale ≤ precision; warns if precision > 19 BINARY,VARBINARYBYTESBinary data DATETIMETIMESTAMPDate and time (no time zone) TIMESTAMPTIMESTAMPTZDate and time with time zone TIMETIMETime of day (no date) BITVARBITVariable-length bit array DATEDATEDate only (no time) TINYBLOB,MEDIUMBLOB,LONGBLOBBYTESBinary data BOOL,BOOLEANBOOLBoolean The following Oracle types are mapped to CockroachDB types:
Oracle type(s) CockroachDB type Notes NCHAR,CHAR,CHARACTERCHAR(n) orCHARFixed-length character; falls back to unbounded if length not specified VARCHAR,VARCHAR2,NVARCHAR2VARCHAR(n) orVARCHARVarying-length string; raises warning if BYTE semantics used STRINGSTRINGUnlimited-length string SMALLINTINT22-byte integer INTEGER,INT,SIMPLE_INTEGERINT44-byte integer LONGINT88-byte integer FLOAT,BINARY_FLOAT,REALFLOAT432-bit float DOUBLE,BINARY_DOUBLEFLOAT864-bit float DEC,NUMBER,DECIMAL,NUMERICDECIMAL(p, s) orDECIMALValidates scale ≤ precision; warns if precision > 19 DATEDATEDate only (no time) BLOB,RAW,LONG RAWBYTESBinary data JSONJSONBCRDB's native JSON format CLOB,NCLOBSTRINGTreated as large text BOOLEANBOOLBoolean TIMESTAMPTIMESTAMPorTIMESTAMPTZIf WITH TIME ZONE→TIMESTAMPTZ, elseTIMESTAMPROWID,UROWIDSTRINGTreated as opaque identifier SDO_GEOMETRYGEOMETRYSpatial type (PostGIS-style) XMLTYPESTRINGStored as text