NEW RasterizedDB 1.1.0 is out: sharding and the gateway, the message broker, roles and row-level security, compression, .NET on NuGet, and the enterprise edition. What's new ›
SQL SURFACE

PostgreSQL's SQL, and then some.

The dialect is PostgreSQL's, checked against PostgreSQL 17 by a differential harness. Beyond SELECT, INSERT, UPDATE and DELETE, here is what a migrating application usually needs, and finds.

1 / 5

Queries

  • Joins of every kind (RIGHT, FULL, NATURAL, USING), LATERAL, correlated subqueries, derived tables, WITH and WITH RECURSIVE
  • UNION, INTERSECT, EXCEPT
  • Window functions with WINDOW clauses, ROLLUP, CUBE and GROUPING SETS, and ordered-set aggregates: percentile_cont, percentile_disc, mode() WITHIN GROUP
  • Row-value comparisons, LIKE / ILIKE ANY and ALL over arrays, regular expressions
  • GROUP BY over computed keys, ORDER BY expressions, DISTINCT ON
2 / 5

Writes

  • MERGE
  • COPY in and out
  • Row locks: FOR UPDATE, FOR SHARE, SKIP LOCKED, NOWAIT
  • Savepoints, and an error inside a block fails the block as in PostgreSQL
SQL
INSERT INTO stock (sku, qty) VALUES ('A-1', 5)
  ON CONFLICT (sku) DO UPDATE SET qty = stock.qty + excluded.qty
  RETURNING qty;

UPDATE orders o SET status = 'late' FROM shipments s
 WHERE s.order_id = o.id AND s.eta < now()
 RETURNING o.id;

DELETE FROM sessions USING users
 WHERE sessions.user_id = users.id AND users.banned;
3 / 5

Schema objects

  • Views, sequences, enums and domains
  • Functions and triggers, with a PL/pgSQL interpreter
  • Foreign keys both ways, CHECK constraints including regular expressions
  • Stored generated columns and defaults; ADD, RENAME, retype and DROP COLUMN
  • DDL inside a transaction block rolls back with it
  • DO blocks, PREPARE and EXECUTE, CREATE TABLE … AS
4 / 5

Sessions

  • SET, SET LOCAL, SHOW, RESET with PostgreSQL's units
  • statement_timeout and cancellation with PostgreSQL's SQLSTATEs
  • LISTEN / NOTIFY
  • EXPLAIN
5 / 5

Not yet

Listed so you find out here and not in production: CREATE TYPE for composites and ranges (enums work), multirange types, multidimensional array literals, NUMERIC NaN, and PARTITION BY RANGE or LIST (tables partition by HASH). The compatibility notes in the repository keep the full list.

✓ page rendered in 136 µs axum + tera + htmx · no other javascript