---
title: "Migrate PostgreSQL to MySQL in your browser"
description: "Migrate a PostgreSQL database to MySQL: convert a pg_dump file into a script with the same tables, keys and data, and a report of every change."
canonical: https://intosql.com/postgresql-to-mysql
last_updated: 2026-10-15
---

# Migrate PostgreSQL to MySQL in your browser

Drop a plain dump from pg_dump or pg_dumpall, as .sql or .sql.gz, and download a script for MySQL with the same tables, keys, indexes and data. Every value MySQL can't hold as it is, and every object it doesn't carry, is listed in the report.

[PostgreSQL to MySQL migration guide](https://intosql.com/docs/migrations/postgresql-to-mysql)

[PostgreSQL to MySQL data types](https://intosql.com/docs/types/postgresql-to-mysql)

## What changes from PostgreSQL to MySQL

Each row is a rule the converter applies, with the report line it writes when the rule changes something in your data.

| In PostgreSQL | In MySQL | Report line |
| --- | --- | --- |
| boolean | tinyint(1) |  |
| varchar(n), char(n), text | varchar(n) up to 1024 characters, char(n) up to 255, text beyond |  |
| numeric(p,s) past 65 digits or 30 decimals, and numeric values past what decimal(65,30) holds | varchar | `decimal_as_text` |
| money | decimal(19,2) | `type_replaced` |
| interval | varchar(100) with PostgreSQL's text | `type_replaced` |
| arrays (integer[], text[]...) | json arrays | `type_replaced` |
| ranges, geometric types, tsvector, xml, hstore, composite and extension types | longtext with PostgreSQL's text | `type_replaced` |
| json, jsonb | json |  |
| timestamp | datetime(p) |  |
| timestamp with time zone | datetime(p) in UTC | `moments_as_utc` |
| time | time(p) |  |
| infinity, -infinity, BC dates and years past 9999 | NULL | `date_out_of_range` |
| NaN and Infinity in numeric, real and double precision | NULL | `invalid_value_null` |
| NOT NULL columns with values that become NULL | NOT NULL dropped | `not_null_relaxed` |
| enum types | enum(...) with the same labels |  |
| uuid, inet, cidr | uuid as char(36), inet and cidr as varchar(43) |  |
| bytea | blob, mediumblob or longblob; varbinary(3072) in a key |  |
| bit(n) | bit(n) up to 64, text beyond |  |
| citext and nondeterministic collations | exact comparison | `case_insensitive_collation` |
| serial, identity | AUTO_INCREMENT, continuing after the highest id |  |
| a second serial or identity column in a table | plain integer | `counter_dropped` |
| sequences not owned by a column | not created | `sequence_not_converted` |
| generated columns | generated columns, STORED as in the source |  |
| generated columns with functions MySQL lacks | a plain column | `generated_not_translated` |
| defaults with functions MySQL lacks, and defaults from a sequence | no default | `default_not_translated` |
| CHECK constraints | translated, inline in CREATE TABLE |  |
| CHECK constraints with functions MySQL lacks | not created | `check_skipped` |
| CHECK ... NOT VALID | not created | `check_not_valid` |
| gin, gist, brin and hash indexes, partial and expression indexes | not created | `index_skipped` |
| foreign keys | foreign keys, loaded with FOREIGN_KEY_CHECKS=0 |  |
| foreign keys to tables the dump doesn't create | not created | `foreign_key_skipped` |
| partitioned tables | one table with every partition's rows | `partitions_dropped` |
| schemas | one database, tables named after their schema first | `schemas_merged` |
| views, functions, procedures, triggers, rules, policies, extensions and types | listed in the report | `not_converted_objects` |
| dumps without CREATE TABLE (--data-only) | types read from the values | `no_schema` |
| expressions in INSERT values | NULL | `expression_value` |
| types IntoSQL doesn't know | longtext | `unknown_type` |
| text that isn't valid in its encoding | the bad bytes as the replacement character | `invalid_utf8_replaced` |
| text decoded twice (Ã±) | copied as it is | `mojibake_suspected` |

## Load the script into MySQL

The script creates the tables, copies the rows, then adds keys, indexes and foreign keys, so it loads fast and stops at the first error.

```shell
mysql --default-character-set=utf8mb4 mydb < postgresql.mysql.sql
```

Foreign keys are created as the dump declares them, with FOREIGN_KEY_CHECKS=0 while the rows load, so a row that points to a missing row doesn't stop the load.

For a large dump, run the client on the same machine as the server, and raise max_allowed_packet if a single row is very large.

IntoSQL Pro loads the file straight into MySQL from the desktop app or the command line, without writing a script.

## Dump PostgreSQL for the best result

The converter reads what the dump holds. These options keep more of your data in it:

- --format=plain, pg_dump's default, writes SQL. A custom or directory archive (-Fc, -Fd) becomes SQL with pg_restore -f dump.sql, without a database server.
- --no-owner --no-privileges leave out roles and grants, which the converter skips anyway, so the dump is smaller.
- pg_dumpall dumps every database in one file; each one's tables are named after it, so nothing collides.

## What isn't converted

Views, materialized views, functions, procedures, triggers, rules, row security policies, extensions and types are written in PostgreSQL's own language. They are listed in the report by name, never dropped silently, so you can rewrite them for MySQL.

## Questions about PostgreSQL to MySQL

### Is my dump uploaded?

No. The converter runs in your browser and reads the dump from your disk in pieces, so it never leaves your computer. The desktop app and the command line convert on your computer too.

### How large can the dump be?

The converter never holds the whole dump in memory: it reads the file twice, by ranges, and writes the script as it goes. Multi-gigabyte dumps convert in the browser, in the desktop app and with the command line.

### Does it read pg_dump -Fc archives?

Not directly: a custom archive is a binary format. pg_restore -f dump.sql dump.backup turns it into the plain SQL the converter reads, without connecting to a server. The converter says so when it gets an archive.

### Which PostgreSQL versions can the dump come from?

Dumps written by pg_dump and pg_dumpall from PostgreSQL 10 on, with COPY or INSERT rows. Every test dump comes from PostgreSQL 13 and 18 and is compared with its source cell by cell.

### Are serial and identity values kept?

Yes, for one column per table: the serial or identity column that leads the primary key becomes AUTO_INCREMENT and continues after the highest id. MySQL counts one column per table, so any other keeps its values without a counter, and the report says so.

### What happens to arrays, enums and other PostgreSQL types?

Arrays become JSON arrays, booleans tinyint(1), enums ENUM with the same labels, and money a decimal. Ranges, geometric types, hstore and composite types keep PostgreSQL's text, and the report says which columns.

### What about functions, triggers and views?

They are listed in the report by name and not converted, because each database writes them in its own language.

### Which MySQL versions does the script load on?

MySQL 5.7 and later. Every test dump loads on 5.7 and 9, stopping at the first error if anything goes wrong.

## From PostgreSQL

- [PostgreSQL to PostgreSQL](https://intosql.com/postgresql-to-postgresql)
- [PostgreSQL to MariaDB](https://intosql.com/postgresql-to-mariadb)
- [PostgreSQL to SQLite](https://intosql.com/postgresql-to-sqlite)
- [PostgreSQL to SQL Server](https://intosql.com/postgresql-to-sql-server)
- [PostgreSQL to Oracle](https://intosql.com/postgresql-to-oracle)

## Into MySQL

- [MySQL to MySQL](https://intosql.com/mysql-to-mysql)
- [MariaDB to MySQL](https://intosql.com/mariadb-to-mysql)
- [SQL Server to MySQL](https://intosql.com/sql-server-to-mysql)
- [SQLite to MySQL](https://intosql.com/sqlite-to-mysql)
- [Oracle to MySQL](https://intosql.com/oracle-to-mysql)

## Guide and every pair

- [MySQL to PostgreSQL](https://intosql.com/mysql-to-postgresql)
- [PostgreSQL to MySQL migration guide](https://intosql.com/docs/migrations/postgresql-to-mysql)
- [PostgreSQL to MySQL data types](https://intosql.com/docs/types/postgresql-to-mysql)
- [Every database pair](https://intosql.com/database-migration)
