SQL Dialect Converter — MySQL to PostgreSQL & SQLite

Free tool for schema migrations and app rewrites — convert MySQL to PostgreSQL, MySQL to SQLite, or any dialect pair. Handles LIMIT, AUTO_INCREMENT, quoting, date functions, and 40+ syntax differences automatically.

Dialect Converter

MySQL → PostgreSQL
→
Converted: 0 changes Input: 0 chars Output: 0 chars
Try an example:

MySQL → PostgreSQL

AUTO_INCREMENT → SERIAL · Backtick ` → Double-quote " · LIMIT stays · CONCAT() → || · IFNULL() → COALESCE() · DATE_FORMAT() → TO_CHAR() · GROUP_CONCAT() → STRING_AGG() · INSERT IGNORE → INSERT ... ON CONFLICT DO NOTHING

PostgreSQL → MySQL

SERIAL → AUTO_INCREMENT · ::type → CAST() · ILIKE → LIKE · || → CONCAT() · COALESCE() stays · TO_CHAR() → DATE_FORMAT() · STRING_AGG() → GROUP_CONCAT() · NOW() stays

MySQL → SQLite

AUTO_INCREMENT → AUTOINCREMENT · NOW() → DATETIME('now') · LIMIT stays · IFNULL() stays · CONCAT() → || · Remove ENGINE= and CHARSET · GROUP_CONCAT() stays · INSERT IGNORE → INSERT OR IGNORE

Frequently Asked Questions

Paste your MySQL SQL query into the input box, select "MySQL" as the source dialect and "PostgreSQL" as the target dialect, then click Convert. The tool automatically translates AUTO_INCREMENT to SERIAL, backtick quoting to double-quote identifiers, CONCAT() to ||, IFNULL() to COALESCE(), and MySQL-specific date functions to PostgreSQL equivalents.

LIMIT/OFFSET syntax, AUTO_INCREMENT vs SERIAL vs AUTOINCREMENT, backtick vs double-quote quoting, ILIKE to LIKE, CONCAT to || operator, type casting (:: vs CAST vs implicit), IFNULL vs COALESCE, DATE_FORMAT vs TO_CHAR vs STRFTIME, NOW() vs CURRENT_TIMESTAMP vs DATETIME('now'), GROUP_CONCAT differences, and INSERT IGNORE vs ON CONFLICT vs INSERT OR REPLACE.

Yes, completely free and private. All conversion happens locally in your browser using JavaScript. Your SQL queries never leave your device. No signup, no server uploads, no usage limits.

Yes. You can convert in any direction: MySQL to PostgreSQL, PostgreSQL to MySQL, MySQL to SQLite, SQLite to MySQL, PostgreSQL to SQLite, or SQLite to PostgreSQL. Just select the source and target dialects and paste your SQL.

Yes. The converter handles CREATE TABLE definitions including AUTO_INCREMENT to SERIAL/GENERATED AS IDENTITY, ENGINE=InnoDB removal, CHARSET removal, ON UPDATE CURRENT_TIMESTAMP translation, and ENUM type differences between MySQL and PostgreSQL (converted to VARCHAR with CHECK constraints).

The converter handles PostgreSQL to SQLite as well: SERIAL becomes INTEGER PRIMARY KEY AUTOINCREMENT, ILIKE becomes LIKE, ::type casts are simplified, || stays as is (SQLite supports it), RETURNING clauses are handled, and sequences (CREATE SEQUENCE) are converted to AUTOINCREMENT on the column definition.

The converter handles 40+ syntax differences across the three dialects, including CREATE TABLE definitions, SELECT queries, INSERT/UPDATE/DELETE, subqueries, CTEs, window functions, and JOINs. For edge cases or dialect-specific features (like MySQL's ON DUPLICATE KEY), the tool applies the closest equivalent. Always review the output before using it in production.

No size limit. All processing is client-side, so the practical limit depends on your browser's memory. For typical development queries (CREATE TABLE, INSERT, SELECT with CTEs), performance is instant. Very large scripts (500+ lines) may take a second or two to process.

Related Tools

SQL Formatter· Dialect Converter Guide· Data Generator Guide· SQL Validator· ER Diagram Tool