12.5.4 PostgreSQL Type Mapping

Table 12.3 Type mapping

Source TypeMySQL TypeComment
INTINT 
SMALLINTSMALLINT 
BIGINTBIGINT 
SERIALINTSets AUTO_INCREMENT in its table definition.
SMALLSERIALSMALLINTSets AUTO_INCREMENT in its table definition.
BIGSERIALBIGINTSets AUTO_INCREMENT in its table definition.
BITBIT 
BOOLEANTINYINT(1) 
REALFLOAT 
DOUBLE PRECISIONDOUBLE 
NUMERICDECIMAL 
DECIMALDECIMAL 
MONEYDECIMAL(19,2) 
CHARCHAR/LONGTEXTDepending on its length. MySQL Server 5.5 and above can have CHAR columns with a length up to 255 characters. Anything larger is migrated as LONGTEXT
NATIONAL CHARACTERCHAR/LONGTEXTDepending on its length. MySQL Server 5.5 and above can have VARCHAR columns with a length up to 65535 characters. Anything larger is migrated to one of the TEXT blob types. In MySQL, character set of strings depend on the column character set instead of the datatype.
VARCHARVARCHAR/MEDIUMTEXT/LONGTEXTDepending on its length. MySQL Server 5.5 and above can have VARCHAR columns with a length up to 65535 characters. Anything larger is migrated to one of the TEXT blob types.
NATIONAL CHARACTER VARYINGVARCHAR/MEDIUMTEXT/LONGTEXTDepending on its length. MySQL Server 5.5 and above can have VARCHAR columns with a length up to 65535 characters. Anything larger is migrated to one of the TEXT blob types. In MySQL, character set of strings depend on the column character set instead of the datatype.
DATEDATE 
TIMETIME 
TIMESTAMPDATETIME 
INTERVALTIME 
BYTEALONGBLOB 
TEXTLONGTEXT 
CIDRVARCHAR(43) 
INETVARCHAR(43) 
MACADDRVARCHAR(17) 
UUIDVARCHAR(36) 
XMLLONGTEXT 
JSONLONGTEXT 
TSVECTORLONGTEXT 
TSQUERYLONGTEXT 
ARRAYLONGTEXT 
POINTVARCHAR 
LINEVARCHAR 
LSEGVARCHAR 
BOXVARCHAR 
PATHVARCHAR 
POLYGONVARCHAR 
CIRCLEVARCHAR 
TXID_SNAPSHOTVARCHAR