SwapSQL

MySQL → PostgreSQL

Convert MySQL VARCHAR to PostgreSQL varchar

VARCHAR looks identical in both engines, but the units differ in spirit: both count characters, yet MySQL's row-size limits and index prefix rules disappear in PostgreSQL.

VARCHAR(n) varchar(n)

What to know

Before / after

MySQL

CREATE TABLE users (
  email VARCHAR(255) NOT NULL UNIQUE
) CHARSET=utf8mb4;

PostgreSQL

CREATE TABLE users (
  email varchar(255) NOT NULL UNIQUE
);

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.