MySQL Workbench Manual  /  ...  /  PostgreSQL Type Mapping

10.6.4 PostgreSQL Type Mapping

Table 10.3 Type mapping

Source Type MySQL Type Comment
INT INT  
SMALLINT SMALLINT  
BIGINT BIGINT  
SERIAL INT Sets AUTO_INCREMENT in its table definition.
SMALLSERIAL SMALLINT Sets AUTO_INCREMENT in its table definition.
BIGSERIAL BIGINT Sets AUTO_INCREMENT in its table definition.
BIT BIT  
BOOLEAN TINYINT(1)  
REAL FLOAT  
DOUBLE PRECISION DOUBLE  
NUMERIC DECIMAL  
DECIMAL DECIMAL  
MONEY DECIMAL(19,2)  
CHAR CHAR/LONGTEXT Depending 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 CHARACTER CHAR/LONGTEXT Depending 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.
VARCHAR VARCHAR/MEDIUMTEXT/LONGTEXT Depending 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 VARYING VARCHAR/MEDIUMTEXT/LONGTEXT Depending 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.
DATE DATE  
TIME TIME  
TIMESTAMP DATETIME  
INTERVAL TIME  
BYTEA LONGBLOB  
TEXT LONGTEXT  
CIDR VARCHAR(43)  
INET VARCHAR(43)  
MACADDR VARCHAR(17)  
UUID VARCHAR(36)  
XML LONGTEXT  
JSON LONGTEXT  
TSVECTOR LONGTEXT  
TSQUERY LONGTEXT  
ARRAY LONGTEXT  
POINT POINT  
LINE LINESTRING Although LINE length is infinite, and LINESTRING is finite in MySQL, it is approximated
LSEG LINESTRING A LSEG is like a LINESTRING with only two points
BOX POLYGON A BOX is a POLYGON with five points and right angles
PATH LINESTRING  
POLYGON POLYGON  
CIRCLE POLYGON A POLYGON is used to approximate a CIRCLE
TXID_SNAPSHOT VARCHAR  


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