SwapSQL

MySQL → PostgreSQL

Convert MySQL INT UNSIGNED to PostgreSQL

PostgreSQL has no unsigned integers. An UNSIGNED column can hold values above the signed maximum, so it must be widened to the next larger type to stay lossless.

INT UNSIGNED bigint

What to know

Before / after

MySQL

CREATE TABLE hits (
  counter INT UNSIGNED NOT NULL
);

PostgreSQL

CREATE TABLE hits (
  counter bigint NOT NULL CHECK (counter >= 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 MySQL → PostgreSQL converter

See the full type mapping table or all guides.