MySQL to PostgreSQL Converter Online

Convert MySQL SQL scripts into PostgreSQL-compatible SQL with local processing, migration warnings, and conversion reports.

Local only • SQL text conversion • No database connection • Review warnings before production use

MySQL input

PostgreSQL output

Ready

How to Use

  1. Paste or upload your MySQL .sql script or schema.
  2. Choose conversion options (identity mode, ENUM strategy, JSON mapping).
  3. Click Convert to PostgreSQL or wait for auto-convert.
  4. Review warnings in the Report and Audit tabs.
  5. Validate PostgreSQL output, then copy or download the converted SQL.

Related tools

Frequently Asked Questions

What is a MySQL to PostgreSQL Converter?

It transforms MySQL SQL text—schemas, queries, and dump snippets—into PostgreSQL-compatible SQL without connecting to a database or migrating live data automatically.

Does it migrate data or only SQL?

It converts SQL text. INSERT statements in a dump are rewritten syntactically, but bulk data migration from a live MySQL database requires tools such as pgloader or ETL pipelines.

Does it execute SQL?

No. The tool never runs SQL against any database. Review and execute converted scripts in your own PostgreSQL environment.

Does it connect to my database?

No. All conversion happens locally in your browser.

Is my SQL uploaded to a server?

No. Your SQL stays on your device. No telemetry or cloud processing is used for conversion.

Which MySQL versions are supported?

Common MySQL 5.x and 8.x DDL/DML syntax including backtick identifiers, ENGINE clauses, AUTO_INCREMENT, ENUM, and JSON columns. Exotic legacy syntax may need manual review.

Which PostgreSQL versions are supported?

Output targets modern PostgreSQL (10+ for IDENTITY columns). SERIAL syntax is available as an option for older compatibility patterns.

How are AUTO_INCREMENT columns converted?

By default to GENERATED ALWAYS AS IDENTITY. You can switch to SERIAL/BIGSERIAL in conversion options.

How are ENUM values handled?

Default mode uses VARCHAR with CHECK constraints. Optional mode emits CREATE TYPE ... AS ENUM before the table definition.

How is JSON converted?

MySQL JSON is mapped to JSONB by default for query performance. You can keep JSON instead.

How is TINYINT(1) handled?

When enabled, TINYINT(1) maps to BOOLEAN. Other TINYINT columns map to SMALLINT.

What happens to UNSIGNED integers?

PostgreSQL has no UNSIGNED modifier. UNSIGNED is removed and a warning suggests adding CHECK (column >= 0) when needed.

Are stored procedures fully supported?

No. Procedures, functions, and triggers receive best-effort conversion with explicit warnings because MySQL and PL/pgSQL differ significantly.

Can it convert SQL dump files?

Yes for reasonably sized .sql files pasted or uploaded in the browser. Very large multi-gigabyte dumps are impractical client-side.

Does it handle DELIMITER blocks?

Yes. MySQL DELIMITER directives are stripped and procedure bodies are normalized to semicolon-terminated statements where possible.

What about ENGINE=InnoDB and CHARSET clauses?

They are removed because PostgreSQL does not use MySQL storage/charset table options. Warnings appear in the conversion report.

Can it convert views?

Simple CREATE VIEW statements are converted with generic syntax and function mapping. Complex views may need manual edits.

Can it convert indexes?

Regular and UNIQUE indexes are converted. FULLTEXT and SPATIAL indexes are flagged for manual migration to tsvector/GIN or PostGIS.

How is ON DUPLICATE KEY UPDATE handled?

A warning is emitted. Rewrite to INSERT ... ON CONFLICT ... DO UPDATE in PostgreSQL with an explicit conflict target.

How is GROUP_CONCAT converted?

Mapped to STRING_AGG with a default comma separator. Verify ordering and separator requirements for your queries.

How is IFNULL converted?

Mapped to COALESCE(), which is the idiomatic PostgreSQL equivalent.

Does it pretty-print PostgreSQL output?

Yes when Pretty-print output is enabled, using PostgreSQL-aware formatting.

Can I validate converted SQL?

Yes. The Validation tab runs PostgreSQL syntax checks. Use the SQL Validator handoff for deeper analysis.

Can I compare before and after?

Yes. Use the Compare handoff to open the SQL Compare tool with MySQL input and PostgreSQL output side by side.

What is the maximum file size?

Small and medium scripts convert instantly. Inputs above ~300 KB use a Web Worker. Practical in-browser limits depend on device memory.

Does it work offline?

Yes after the page loads because processing is client-side.

What browsers are supported?

Modern Chromium, Firefox, Safari, and Edge with Web Worker and localStorage support.

Is this tool free?

Yes. No account or per-conversion charge.

Should I trust converted SQL in production without review?

No. Always review warnings, test on staging, validate constraints/indexes, and verify application queries before production migration.

Does it replace pgloader or cloud migration services?

No for large live database migrations. It complements them by converting SQL text quickly and privately for schema review and prototyping.

Can I download conversion reports?

Yes. Export TXT, JSON, and HTML reports with per-statement status and warnings.

Is PostgreSQL to MySQL conversion available?

Use the SQL Server to MySQL Converter for Microsoft SQL Server scripts. For PostgreSQL-to-MySQL, convert via intermediate steps or dedicated migration tooling.