SwapSQL

MySQL → PostgreSQL

Convert MySQL TINYINT(1) to PostgreSQL boolean

MySQL has no real boolean type — TINYINT(1) is the de-facto convention. PostgreSQL has a native boolean, so the correct migration turns 0/1 into false/true.

TINYINT(1) boolean

What to know

Before / after

MySQL

CREATE TABLE users (
  is_admin TINYINT(1) NOT NULL DEFAULT 0
);

PostgreSQL

CREATE TABLE users (
  is_admin boolean NOT NULL DEFAULT false
);

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.