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,LIMITandOFFSET—LIMIT n OFFSET mpages by a wider bounded read with the skip's cost on the port, exact underORDER BY— and value-listIN, with Parse-time parameter inference for the extended protocol. - Writes:
INSERT,UPDATE,DELETEwithRETURNINGand honest counts, andCREATE TABLE/DROP TABLE/ALTER TABLEfor migrations —ADD COLUMN(withNOT NULLand aDEFAULTthe 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. jsonandjsonbcolumns: 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\dand\dtrender 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.