SQL Converter · PostgreSQL → Redshift
Convert PostgreSQL SQL to Redshift
PostgreSQL to Redshift swaps interval math for DATEADD, now() for GETDATE() and STRING_AGG for LISTAGG. A mechanical formatter only re-indents — it won’t rewrite dialect-specific syntax. The AI converter in the app translates the query and the table below shows exactly what changes.
PostgreSQL — source
Redshift — converted
What changes from PostgreSQL to Redshift
| PostgreSQL | Redshift | Why |
|---|---|---|
| STRING_AGG(x, ',') | LISTAGG(x, ',') WITHIN GROUP | Redshift uses LISTAGG with an explicit WITHIN GROUP order. |
| now() - INTERVAL '30 days' | DATEADD(DAY, -30, GETDATE()) | Redshift prefers DATEADD for date math. |