SQL Formatter for PostgreSQL

PostgreSQL has syntax that trips up generic SQL formatters β€” RETURNING clauses, ON CONFLICT upserts, ::type casts, and CTEs with MATERIALIZED. Use a generic formatter and your carefully written Postgres query comes out looking worse than it went in.

This PostgreSQL SQL formatter knows Postgres dialect rules. It indents CTEs correctly, preserves :: cast spacing, and doesn't mangle RETURNING or ON CONFLICT blocks.

Pick PostgreSQL from the dropdown and paste the query you've been dreading to format. You'll see the difference in one click.

🧹 SQL Formatter