Home > Documentation > PostgreSQL to MySQL

PostgreSQL to MySQL Types Mapping

[Postgres to MySQL Converter]  [About Migration]  [FAQ

Although PostgreSQL and MySQL have similar data types, those sets are not absolutly equal. When migrating from PostgreSQL to MySQL, MariaDB or Percona it is necessary to map data types accordng to the table below:

PostgreSQL MySQL
ARRAY LONGTEXT
BIGINT BIGINT
BIGSERIAL BIGINT auto_increment
BOOLEAN BIT
BYTEA LONGBLOB
CHAR(n), CHARACTER(n) CHAR(n), CHARACTER(n)
CIDR VARCHAR(43)
DATE DATE
DECIMAL(p,s), DEC(p,s) DECIMAL(p,s), DEC(p,s)
DOUBLE PRECISION DOUBLE
FLOAT(p) FLOAT(p)
INET VARCHAR(43)
INT, INTEGER INT
INTERVAL TIME
JSON LONGTEXT
LINE LINESTRING
MONEY DECIMAL(19,2)
NUMERIC(p,s) DECIMAL(p,s)
REAL FLOAT
SERIAL INT IDENTITY
SMALLINT SMALLINT
TEXT LONGTEXT
TIME(p) TIME(p)
TIMESTAMP DATETIME
TSVECTOR LONGTEXT
TSQUERY LONGTEXT
UUID VARCHAR(36)
VARCHAR(n) VARCHAR(n)
XML LONGTEXT