SQLFormatter
FormatterConvertPricingDocsGet Pro
SQL Converter · PostgreSQLBigQuery

Convert PostgreSQL SQL to BigQuery

PostgreSQL to BigQuery swaps "double quotes" for `backtick` table refs, || for CONCAT() and now() for CURRENT_TIMESTAMP(). 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
PostgreSQL
SELECT u.id,
       u.first || ' ' || u.last AS name
FROM users u
WHERE u.created_at > now() - INTERVAL '7 days'
ORDER BY u.created_at DESC
LIMIT 100;
BigQuery — converted
BigQuery
SELECT u.id,
       CONCAT(u.first, ' ', u.last) AS name
FROM proj.dataset.users u
WHERE u.created_at > TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
ORDER BY u.created_at DESC
LIMIT 100;
Convert your own query

What changes from PostgreSQL to BigQuery

PostgreSQLBigQueryWhy
FROM usersFROM `proj.dataset.users`BigQuery references fully-qualified, backtick-quoted table names.
a || bCONCAT(a, b)BigQuery uses CONCAT(); || is not a string operator.
now() - INTERVAL '7 days'TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)Timestamp math uses TIMESTAMP_SUB.

Other SQL conversions

PostgreSQLMySQLPostgreSQLT-SQLPostgreSQLRedshiftMySQLBigQueryPostgreSQLSnowflakeSnowflakeBigQueryAll conversions →