MySQL vs PostgreSQL: Key Syntax Differences
By Sharon Ben-Moshe · June 25, 2026 · 3 min read
Sharon Ben-Moshe is the founder of sqlfmt, a browser-based SQL formatter and validator with misspelled-keyword suggestions across PostgreSQL, MySQL, SQLite, SQL Server, and BigQuery.
The MySQL vs PostgreSQL syntax differences that break migrations: auto-increment, quoting, string concat, upserts, and NULL functions — with side-by-side SQL.
Quick answer
The main MySQL vs PostgreSQL syntax differences are: auto-increment (AUTO_INCREMENT vs GENERATED AS IDENTITY/SERIAL), identifier quoting (backticks vs double quotes), string concatenation (CONCAT() vs the || operator), and upserts (ON DUPLICATE KEY UPDATE vs ON CONFLICT). PostgreSQL follows the SQL standard more closely; MySQL has more permissive, non-standard shortcuts.