SwapSQL

MySQL → PostgreSQL

Convert MySQL TIMESTAMP to PostgreSQL timestamptz

MySQL TIMESTAMP values are stored in UTC and rendered in the session time zone — semantically closest to PostgreSQL's timestamptz.

TIMESTAMP timestamptz

What to know

Before / after

MySQL

CREATE TABLE posts (
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

PostgreSQL

CREATE TABLE posts (
  created_at timestamptz DEFAULT now()
);

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.