PostgreSQL → MySQL
Convert PostgreSQL boolean to MySQL
MySQL's BOOLEAN keyword is just an alias for TINYINT(1), so true/false become 1/0. Queries keep working because MySQL treats them as truthy/falsy.
boolean → TINYINT(1)
What to know
- boolean → TINYINT(1); true → 1, false → 0
- DEFAULT true → DEFAULT 1
- WHERE active stays valid in MySQL (non-zero is true)
- Watch ORMs: configure the column as boolean so they cast 1/0 back properly
Before / after
PostgreSQL
active boolean NOT NULL DEFAULT true MySQL
active TINYINT(1) NOT NULL DEFAULT 1 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 PostgreSQL → MySQL converterSee the full type mapping table or all guides.