PostgreSQL → MySQL
Convert PostgreSQL numeric to MySQL DECIMAL
Exact decimals map cleanly — with one caveat: MySQL caps precision at 65 digits and scale at 30, while PostgreSQL allows far more (and even unconstrained numeric).
numeric(p,s) → DECIMAL(p,s)
What to know
- numeric(p,s) → DECIMAL(p,s) unchanged when p ≤ 65 and s ≤ 30
- Unconstrained numeric → DECIMAL(65,30) with a warning — check your extreme values
- Values that exceed the target precision will be flagged during validation
- Money type → store as DECIMAL and keep currency in a separate column
Before / after
PostgreSQL
balance numeric(12,2) DEFAULT 0 MySQL
balance DECIMAL(12,2) DEFAULT 0 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.