Reference
SQL
What Chronos runs, the statements only Chronos has, and where it differs from Postgres 16.
SoonThese pages describe Chronos Cloud, which opens from the waitlist. Running Chronos yourself? Self-host docs
Overview
Chronos runs SQL itself, with its own parser and executor, and speaks the Postgres 16 wire protocol, so psql, drivers, ORMs and GUI tools connect as to Postgres. It aims to give the same answers and the same SQLSTATE codes; what it can’t do yet is an error (0A000 for a known feature, 42601 for syntax it doesn’t parse), never a silent wrong answer.
| Measure | Result |
|---|---|
| Postgres 16’s own regression suite, line by line | 88.98% of expected lines; 66 of 219 files identical |
| Real databases moved in, checked by row checksums | 7 of 7 identical |
| Differential tests against a real Postgres 16 | 468 tests, same rows or same error class |
Statements only Chronos has
| Statement | Does | Docs |
|---|---|---|
CREATE WORLD / FORK WORLD | an instant copy | Worlds |
SWITCH WORLD / USE | move the session to a world | Worlds |
SHOW WORLDS / SHOW BRANCHES | list worlds | Worlds |
ALTER WORLD | metadata, TTL, pin | Worlds |
DROP WORLD | discard | Worlds |
DIFF [… TO …] [AS SQL] [READERS] | what changed, and what reads it | Diff and merge |
MERGE WORLD … [DRY RUN] | land a world, or preview it | Diff and merge |
REBASE WORLD | take in the parent’s changes | Diff and merge |
UNDO MERGE | take a merge back | Diff and merge |
CHECK READS | did anything a world read change? | Stale reads |
… AS OF when | a table as it was | History |
RESTORE WORLD, CHECKPOINT WORLD | go back to a moment or a label | History |
UNDO AGENT … SINCE | take back one agent’s changes | History |
SHOW HISTORY, SHOW AUDIT | what happened, and who did it | History |
SIMULATE, REPLAY WORLD | many worlds at once, scored | Simulations |
CREATE / ALTER / DROP MERGE POLICY, SHOW REVIEWS | rules for agents’ merges | Merge policies |
REVIEW WORLD … APPROVE | REJECT | PASS | a reviewer agent’s decision | Merge policies |
CREATE / DROP MERGE CHECK | rules about the merged data | Merge checks |
CREATE / ALTER / DROP AGENT, SHOW AGENTS | who acts, and with what rights | Concepts |
REGISTER READER, MARK READER … CRITICAL | name what reads a column | Diff and merge |
SHOW MERGE OUTCOMES | how agents’ worlds ended | Merge policies |
SHOW STORAGE, SHOW DISK | what each world costs; the database’s size | |
search('table', 'words', k) | ranked, typo-tolerant text search | Vectors and search |
What works
- Statements:
CREATE/ALTER/DROP TABLE, indexes (btree, unique, partial, expression,gin,gist,hnsw),INSERT(multi-row,… SELECT,ON CONFLICT DO NOTHING | DO UPDATE),SELECT,UPDATE,DELETE,TRUNCATE,RETURNING,COPY,EXPLAIN [ANALYZE],PREPARE/EXECUTE, views and materialized views, sequences, schemas andsearch_path, enums and domains, temporary tables,LISTEN/NOTIFY,CREATE TABLE AS,SELECT INTO. - Queries: inner, left, right, full and cross joins,
USING,NATURAL, lateral subqueries,WITHandWITH RECURSIVE, window functions,GROUP BYwithROLLUP,CUBEandGROUPING SETS,DISTINCT ON,FILTER, ordered-set aggregates,FETCH FIRST … WITH TIES, row comparisons for keyset pagination. - Constraints: primary keys of one or several columns,
NOT NULL,DEFAULT,CHECK,UNIQUE(incl.NULLS NOT DISTINCT),EXCLUDE, foreign keys with everyON DELETE/ON UPDATEaction, deferrable foreign keys. All are checked again at every merge, on the merged result. - Code:
CREATE FUNCTIONin SQL and PL/pgSQL, triggers (row and statement,BEFORE/AFTER/INSTEAD OF),DOblocks,RAISE, exception handling. - Security: roles and privileges (
GRANT,REVOKE,SET ROLE), row-level security policies. - Functions: Postgres’s text, math, date, JSON/jsonb, array, regular expression (its own engine, checked on thousands of random patterns), formatting and statistical functions, with Postgres’s names, null rules and edge cases.
Types
integer, bigint, smallint, double precision, real, numeric(p, s) (exact, up to 38 digits), text, varchar(n), char, uuid, boolean, bytea, json, jsonb, date, time, timestamp, timestamptz, interval, arrays of these, enums, domains, vector(n), tsvector/tsquery, inet/cidr/macaddr, citext, hstore, ltree, and PostGIS geometry/geography points. Any other type name is 42704, naming these.
Serial numbers and worlds
serial, identity and sequence numbers come from counters that belong to the database, not a world: rows inserted in two worlds never collide when both merge, and main may see gaps where a world took numbers. Use gen_random_uuid() for keys if gaps matter to you.
Extensions
Extensions with C code can’t be loaded; these are built in, and CREATE EXTENSION for them is accepted:
| Extension | Notes |
|---|---|
vector | pgvector: vector(n), <=>, <->, <#>, HNSW |
postgis | points: ST_MakePoint, ST_Distance, ST_DWithin, GiST-indexed nearest neighbour. Not yet lines and polygons |
pgcrypto | digest, hmac, crypt/gen_salt, gen_random_bytes, encrypt/decrypt, pgp_sym_* |
uuid-ossp | uuid_generate_v4() and friends |
pg_trgm, fuzzystrmatch, unaccent | similarity, %, trigram indexes, levenshtein, soundex, metaphone |
citext, hstore, ltree | as in Postgres |
Transactions
READ COMMITTEDby default;REPEATABLE READwith row locks that wait as Postgres’s do;SERIALIZABLErefused (0A000).- Savepoints,
SELECT … FOR UPDATE | SHARE, advisory locks. - World statements can’t run inside a transaction (
25001). A transaction’sCOMMITisn’t a merge: merge checks and policies don’t run for it. - Outside a transaction each statement commits on its own.
Differences that bite
- Filtering on an unindexed column is answered from an in-memory search index of the table, which can take a lot of memory on big tables. Give columns you filter on a btree index.
- `ALTER TABLE … RENAME TO` and `SET SCHEMA` rewrite every row (about 6.5 s per million). Renaming a column, adding and dropping columns write only the catalog.
- Text sorts by bytes (as
COLLATE "C") unless a column has an ICU collation. - Enum columns reach clients typed `text`, and function signatures in the catalog show
textforvarcharparameters. - `EXPLAIN` doesn’t show Postgres’s plans except for simple ones: don’t parse it.
- `hash` and `brin` indexes are btrees, and GIN indexes find rows only on
tsvectorand trigram expressions. - `ADD CONSTRAINT … NOT VALID` checks existing rows where Postgres adds it unchecked.
Known gaps
Each is an error, not a wrong answer:
- functions in C or any language but SQL and PL/pgSQL; extensions with C code beyond the built-in ones;
CREATE ACCESS METHODand custom operator classes;SERIALIZABLEisolation;- replication (physical or logical), tablespaces,
pg_hba.conf; ts_headline,ts_rank_cd; PostGIS beyond points;ST_Transform;MATCH PARTIALforeign keys; deferrable unique constraints.
# in the dashboard's SQL editor: create world schema_test;psql "$(echo "$DATABASE_URL" | sed 's#/main?#/schema_test?#')" -f schema.sql 2>&1 | grep ERROR# then discard schema_test: main never saw it