r/SQL • u/No_Ambition8323 • Sep 04 '26
Discussion Database-Specific SQL Differences
Have you ever written a SQL query that works perfectly in one database but fails in another?
What SQL feature or syntax surprised you the most when switching between DBMSs like MySQL, PostgreSQL, SQL Server, Oracle, or Snowflake?
13
Upvotes
View all comments
Show parent comment
3
u/Thadrea Data Science Manager Sep 04 '26
This is only partly correct. Postgres has had index-based clustering for over 25 years, but it's not automatic.
https://www.postgresql.org/docs/current/sql-cluster.html
This has important management implications. If you intend to leverage clustering you need to implement jobs to periodically recluster the table because it's not going to be done for you.
Nonetheless, saying that Postgres doesn't support index-based record clustering at all is simply not correct.