Docs
  • 0.49.1latest
  • 0.48.0
  • 0.47.0
  • 0.46.0
  • 0.45.0
  • 0.44.0
  • 0.43.0
  • 0.42.0
  • 0.41.0
  • 0.40.0
  • 0.39.6
  • 0.39.5
  • 0.39.3
  • 0.39.2
  • 0.39.1
  • 0.39.0
  • 0.38.4
  • 0.38.2
  • 0.38.1
  • 0.37.1
  • 0.37.0
  • 0.36.2
  • 0.36.1
  • 0.36.0
  • 0.35.3
  • 0.35.2
  • 0.35.1
  • 0.35.0
  • 0.34.4
  • 0.34.3-beta
  • 0.34.2-beta
  • 0.34.1-beta
  • 0.34.0-beta
  • 0.33.4-beta
  • 0.33.3-beta
  • 0.33.2-beta
  • 0.33.1-beta
  • 0.33.0-beta
  • 0.32.0-beta

The relational wire

Point psql or a driver at the node's relational-wire port. Tables are the store's own tables, a block is one store transaction with the store's own undo, catalog introspection answers what the dialect's clients ask — and OFFSET paging, ALTER TABLE, session SETs and json columns ride the same wire.

--pg <host:port> (or TESSARIDB_PG) makes a node speak the relational wire protocol, on port 5432 by convention. A client that speaks the dialect — psql, psycopg, a driver — connects to that address and works on the store's own tables. The tables live in the same store, the same snapshots and the same transactions as everything else a TessariQL statement reaches. The port is off until it is named; nothing speaks it by accident.

tessaridb ./data --serve 0.0.0.0:9080 --pg 0.0.0.0:5432

A client, unchanged

This is ordinary client code. Only the address and the credentials are the node's:

import psycopg

with psycopg.connect("host=node.example port=5432 dbname=main user=app password=…") as conn:
    with conn.cursor() as cur:
        cur.execute("SELECT name FROM orders WHERE band = %s", (3,))
        print(cur.fetchall())

A connection is a session: SET search_path moves it between namespaces, and BEGIN … COMMIT opens a block whose statements share one snapshot — the store's own repeatable reads — with ROLLBACK undoing what the block buffered, however many statements it held. The parameters the greeting reports — client_encoding, DateStyle, TimeZone, application_name, the rest of the reported set — accept SET and answer SHOW from the connection's own hold; a changed value rides ParameterStatus as the dialect counts it. Only search_path changes what the store reads — a SET of any other parameter is session bookkeeping, reported back exactly, and a value the port cannot honestly perform (another encoding, another zone) refuses by name rather than pretending.

What the wire speaks

  • The query subset: projections, conditions, joins, aggregates, GROUP BY, HAVING, ORDER BY, LIMIT and OFFSET — LIMIT n OFFSET m pages by a wider bounded read with the skip's cost on the port, exact under ORDER BY — and value-list IN, with Parse-time parameter inference for the extended protocol.
  • Writes: INSERT, UPDATE, DELETE with RETURNING and honest counts, and CREATE TABLE / DROP TABLE / ALTER TABLE for migrations — ADD COLUMN (with NOT NULL and a DEFAULT the declaration backfills), DROP COLUMN, RENAME, ALTER COLUMN TYPE, on the engine's own table verbs. Dropping a column keeps the values stored in existing records; the answer carries a warning saying so.
  • json and jsonb columns: JSON text written to them lands as the object it spells, the answers render as JSON, and the navigation operators — ->, ->>, @> — read inside the document on the engine's own path and containment.
  • Transaction verbs, alone or inside one query string, and — on the extended protocol — as prepared statements too: Parse("BEGIN") binds and executes like any statement.
  • Catalog introspection: the dialect's clients interrogate pg_catalog-shaped relations that the store's own introspection answers — psql's \d and \dt render a table's shape, columns, defaults and types end to end.
  • The binary formats of the fixed scalars, for the extended protocol.

Everything the dialect allows but this build does not speak refuses by name (0A000), never approximates: OFFSET with a parameter or expression, ALTER TABLE constraints and per-option mutations, session values the port cannot perform, the wider JSON operator and function library, and the authentication mechanisms beyond the store's own sign-in. What answers, answers exactly; what does not, says so.