SwapSQL

MySQL → PostgreSQL

Convert MySQL ENUM to PostgreSQL enum types

Both engines support enums, but PostgreSQL enums are standalone named types rather than inline column definitions, so each MySQL ENUM column gets its own CREATE TYPE.

ENUM CREATE TYPE … AS ENUM

What to know

Before / after

MySQL

CREATE TABLE users (
  status ENUM('active','banned','pending') DEFAULT 'pending'
);

PostgreSQL

CREATE TYPE users_status AS ENUM ('active','banned','pending');
CREATE TABLE users (
  status users_status DEFAULT 'pending'
);

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.