MySQL Workbench Manual  /  ...  /  PostgreSQL Type Mapping

10.6.4 PostgreSQL Type Mapping

Table 10.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
POINTPOINT
LINELINESTRINGAlthough LINE length is infinite, and LINESTRING is finite in MySQL, it is approximated
LSEGLINESTRINGA LSEG is like a LINESTRING with only two points
BOXPOLYGONA BOX is a POLYGON with five points and right angles
PATHLINESTRING
POLYGONPOLYGON
CIRCLEPOLYGONA POLYGON is used to approximate a CIRCLE
TXID_SNAPSHOTVARCHAR


User Comments
Sign Up Login You must be logged in to post a comment.