SwapSQL

MySQL → PostgreSQL

Convert MySQL DECIMAL to PostgreSQL numeric

Exact-precision money and quantity columns convert one-to-one: DECIMAL(p,s) and numeric(p,s) share semantics, so no values change.

DECIMAL(p,s) numeric(p,s)

What to know

Before / after

MySQL

CREATE TABLE orders (
  total DECIMAL(12,2) NOT NULL DEFAULT 0.00
);

PostgreSQL

CREATE TABLE orders (
  total numeric(12,2) NOT NULL DEFAULT 0.00
);

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.