SwapSQL

MySQL → PostgreSQL

Convert MySQL SET to PostgreSQL arrays

PostgreSQL has no SET type. The natural mapping is a text array (text[]), which supports the same "multiple choices from a list" idea with far better querying.

SET text[]

What to know

Before / after

MySQL

CREATE TABLE articles (
  flags SET('draft','featured','archived')
);

PostgreSQL

CREATE TABLE articles (
  flags text[]
);
-- query: WHERE 'featured' = ANY(flags)

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.