PostgreSQL has very similar syntax to MySQL, but some commands differ which can be annoying when switching between the two flavors of SQL. That's why we put together a quick reference list of all the syntax differences for commonly used SQL commands:
Purpose | PostgreSQL | MySQL | ||
---|---|---|---|---|
Select with Offset | ||||
Case-Insensitive Matching | ||||
Substring | ||||
Extract Date Part | ||||
Add Interval to Date | ||||
Date Difference | ||||
JSON Field Extraction | ||||
Full-Text Search | ||||
Regex Matching | ||||
Random Row | ||||
Limit with Ties | ❌ Not supported; must emulate manually |
For more a detailed look at the SQL syntax differences for date-time functions, read this article on MySQL vs. PostgreSQL for Date and Time Functions:
And to actually put these SQL skills to the test, try these MySQL/PostgreSQL interview questions: