PostgreSqlIq
Postgres for IQ

One Postgres, from your desk to the cluster.

PostgreSqlIq is the store under IQ. On the laptop it is PostgreSQL 17 embedded in the app, with graphs and search. In the cloud it is the same Postgres on Citus, with the transaction guarantees teams used to buy from MarkLogic. Between the two, change data capture ships every change and loses none, even when you work offline.

Local first, cluster when you need it

The same tables and identifiers on both sides. Your work runs against the local copy, and the cluster is the governed record at scale.

Local

Embedded on the desktop

PostgreSQL 17 shipped inside the IQ app through pgembed. It runs on a unix socket, with no port open and no Homebrew or system install.

  • Apache AGE compiled in: openCypher graphs in Postgres
  • Full-text search and vectors on the same rows
  • Works offline as the app's working memory
Remote

Citus, on demand

The same Postgres spread across hosts. A document, its triples, its text and its vector commit in one transaction.

  • Two-phase commit across workers
  • SHACL shapes checked at commit
  • Hot rows in Postgres, cold history in Iceberg
  • Parks itself when idle, restores on demand
CDC

Changes, shipped safely

Postgres's own logical replication streams the desktop to the server while the server is up. No Kafka, no Debezium.

  • Nothing lost, nothing doubled
  • Identity never leaves the box
  • Row filters and column lists
  • Lag shown on the IQ Dashboard

MarkLogic's guarantees, built on Postgres

What a multi-model database promises, and how PostgreSqlIq's Citus cluster delivers each one.

The guaranteeHow Citus does it
Document, triples, text and vector in one transactionEach record and its triples live on the same shard, keyed by the record's IRI, so a write is plain single-node Postgres ACID.
Inference at query time, inside the transactionIQ's RDFS-Plus rules run as SQL inside the caller's transaction, so they see that transaction's own writes.
The vocabulary everywhere a query runsA reference table: a copy on every node, changed by two-phase commit.
Transactions across hostsCitus two-phase commit: both workers prepare before either commits.
No lost updatesREPEATABLE READ on the shard: the later writer gets a serialization failure.
Scale by adding hostsAdd a node and rebalance online; writes continue during the move.
Only governed writesAgents cannot write directly. One role writes, and only after IQ's gate approves the operation.

Tested, not promised

Each guarantee is a scenario that runs against the real store.

12ACID scenarios, on both cluster layouts
15SHACL-at-commit scenarios
38/38data-plane conformance checks on the cluster
46CDC scenarios, from crashes to identity

CDC that waits instead of losing

The desktop streams to the IQ Server through a replication slot. Each property below has a scenario that tests it.

Only while the server is up

If the server doesn't answer, nothing is read and nothing advances. Changes wait in the slot.

Nothing is lost

The slot only advances past transactions the server has fully acknowledged.

Nothing is doubled

Every change has a stable key, so a resend after a crash is recognized and dropped.

Your disk is protected

WAL held for an idle slot is capped at 1 GB, so a long outage never fills the disk.

Limits

No global snapshot across workers. A read spanning two workers during a two-phase commit can see one side committed and not the other. Keeping each governed write on one shard confines this to multi-record reads that race multi-record writes.

Query-time inference costs per query. Fine at vocabulary scale. A graph of millions of triples needs the inference scoped.

AGE does not distribute. At cluster scale the graph is a plain table of triples, not AGE.

Get started

PostgreSqlIq ships inside IQ at vendor/PostgreSqlIq.

# bring up the desktop store and print its connection string
local/iq-pg.sh
local/iq-pg.sh --check

# the cluster, when you need it
remote/deploy-citus.sh up

# stream the desktop to the IQ Server
cdc/iq-cdc.sh setup
cdc/iq-cdc.sh run