Redshift Adapter

Generate Amazon Redshift SQL from your model.

What the adapter emits

  • Identifiers in "double quotes"; bare column names in expressions are lowercased.
  • Date literals as '2026-01-01'::DATE; grain truncation as DATE_TRUNC('month', x); parts with EXTRACT(YEAR FROM x), EXTRACT(DOW FROM x).
  • CTEs for the per-fact subqueries and a FULL OUTER JOIN when a query blends measures from two facts.
  • No array functions: expression.array: true is not supported on this adapter.

Configuration

redshift_dw:
  adapter: redshift
  name: Redshift Warehouse
  tier: warm
  host: default-workgroup.123456789012.us-east-1.redshift-serverless.amazonaws.com
  port: 5439
  database: analytics
  schema: analytics
  username: reader
  # password: never here; zsql deploy strips it if present

Connection fields

0sql never connects to Redshift. The fields above are carried as metadata for your own application, which runs the SQL it gets back; provisioned clusters and serverless workgroups differ only in the endpoint your application dials. 0sql never uses them. If a password does land in datasources.yml, zsql deploy strips it before building the archive.

Notes

  • Postgres-like, not Postgres. Redshift speaks the Postgres wire protocol but its SQL differs; the adapter emits Redshift forms where they diverge. Write expression.sql for Redshift: approximate count(distinct x), listagg, median.
  • Pair with a hot tier. Redshift is a good system of record; route recent-data queries to ClickHouse or DuckDB in front of it with a partition. See Semantic Routing.

Next Steps