---
title: "Migrate PostgreSQL to MariaDB in your browser"
description: "Migrate a PostgreSQL database to MariaDB: 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-mariadb
last_updated: 2026-10-15
---

# Migrate PostgreSQL to MariaDB in your browser

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

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

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

## What changes from PostgreSQL to MariaDB

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 MariaDB | 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 uuid, 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 | CREATE SEQUENCE, at the value it hands out next |  |
| generated columns | generated columns, STORED as in the source |  |
| generated columns with functions MariaDB lacks | a plain column | `generated_not_translated` |
| defaults with functions MariaDB lacks, and defaults from a sequence | no default | `default_not_translated` |
| CHECK constraints | translated, inline in CREATE TABLE |  |
| CHECK constraints with functions MariaDB 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 MariaDB

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
mariadb --default-character-set=utf8mb4 mydb < postgresql.mariadb.sql
```

Foreign keys are created as the dump declares them, with FOREIGN_KEY_CHECKS=0 while the rows load, as mysqldump does.

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 MariaDB 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 MariaDB.

## Questions about PostgreSQL to MariaDB

### 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. Sequences not owned by a column become MariaDB sequences at the value they had reached.

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

Arrays become JSON arrays, booleans tinyint(1), enums ENUM with the same labels, uuid UUID, 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 MariaDB versions does the script load on?

MariaDB 10.11 and later. Every test dump loads on 10.11 and 11.4, stopping at the first error if anything goes wrong.

## From PostgreSQL

- [PostgreSQL to PostgreSQL](https://intosql.com/postgresql-to-postgresql)
- [PostgreSQL to MySQL](https://intosql.com/postgresql-to-mysql)
- [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 MariaDB

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

## Guide and every pair

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