SwapSQL

MySQL → PostgreSQL

Convert MySQL TEXT types to PostgreSQL text

MySQL has four TEXT sizes because of storage internals. PostgreSQL needs just one: text has no length limit and no performance penalty versus varchar.

TINYTEXT … LONGTEXT text

What to know

Before / after

MySQL

CREATE TABLE posts (
  body MEDIUMTEXT,
  KEY idx_body (body(191))
);

PostgreSQL

CREATE TABLE posts (
  body text
);
CREATE INDEX idx_body ON posts (body);

Don't convert column-by-column — convert the whole database.

Upload a dump, get back ready-to-import SQL with this mapping (and every other one) applied.

Open the MySQL → PostgreSQL converter

See the full type mapping table or all guides.