# v0.46.0 — Extract `pg_tide`: standalone transactional outbox, inbox, and relay

> **Full technical details:** [v0.46.0.md-full.md](v0.46.0.md-full.md)

**Status: ✅ Released** | **Scope: Large**

> The outbox, inbox, and relay subsystems are extracted from `pg_trickle` into
> a new standalone extension `pg_tide` (repository: `trickle-labs/pg-tide`).
> After this release, `pg_trickle` ships exactly one thing: incremental view
> maintenance. Event messaging becomes a first-class product in its own right.

---

## What is this?

`pg_trickle` has shipped a transactional outbox, idempotent inbox, and a
multi-backend relay binary since v0.28–v0.29. Those features are powerful but
they have always been an awkward fit inside an IVM extension: different
audience, different release cadence, different deployment story.

v0.46.0 completes the architectural rationalisation: the entire outbox/inbox
stack is lifted into `pg_tide`, a new Postgres extension that is **genuinely
useful without `pg_trickle`** — it implements the textbook transactional
outbox pattern for any application. `pg_trickle` retains a thin
`attach_outbox()` integration that publishes refresh-time deltas into a
`pg_tide` outbox, preserving the single-transaction atomicity guarantee.

This is a clean break (no migration tooling, no deprecation shims) because
the outbox/inbox/relay features have no known production users at the time of
the cut. A one-line announcement to the discussions board is posted before
Day 4's deletion lands on `main`.

---

## What ships in `pg_tide`

**Extension (`trickle-labs/pg-tide`):**

- `tide.outbox_create()` / `tide.outbox_publish()` / `tide.outbox_status()` —
  generic transactional outbox with claim-check sidecar for large payloads.
- `tide.inbox_create()` / `tide.inbox_mark_processed()` / `tide.inbox_mark_failed()` —
  idempotent inbox with DLQ, priority tiers, replay, and retention.
- `tide.relay_set_outbox()` / `tide.relay_set_inbox()` / `tide.relay_enable()` —
  relay pipeline configuration catalog.
- Built-in `_pending` / `_dlq` / `_stats` views as plain VIEWs (no IVM
  overhead needed — working sets are bounded by definition).
- Background retention drainer for old outbox/inbox rows.

**Binary (`pg-tide`):**

- Today's `pgtrickle-relay` crate moved verbatim; renamed to `pg-tide`.
- All six source backends (NATS, Kafka, webhook, Redis, SQS, RabbitMQ,
  outbox poller) and eight sink backends unchanged.
- Binary version history preserved via `git filter-repo`.

---

## What changes in `pg_trickle`

- `enable_outbox()` and `create_inbox()` are removed (clean break).
- New `pgtrickle.attach_outbox()` replaces them: calls `tide.outbox_create()`
  and registers a refresh-time hook that calls `tide.outbox_publish()` via
  SPI inside the refresh MERGE transaction — atomicity per ADR-001/ADR-002
  fully preserved.
- Relay catalog SQL (~240 LOC) and relay Rust crate (~3,650 LOC) deleted.
- `Dockerfile.relay` deleted; relay CI jobs removed from `release.yml`.
- `pgtrickle-relay` removed from workspace `members` in `Cargo.toml`.
- Upgrade script drops all old `pgtrickle.relay_*` / outbox/inbox API objects.

**Total LOC removed from this repo: ~6,150 Rust + ~2,500 SQL.**

---

## Why this matters

There is no Postgres extension today that ships the transactional outbox
pattern as a batteries-included primitive with a multi-backend relay binary.
`pg_tide` fills that gap. For `pg_trickle` users nothing changes except the
API name (`attach_outbox()` instead of `enable_outbox()`); for the broader
ecosystem, `pg_tide` becomes installable and useful independently.

---

## Scope note

This is a Large release on both sides: significant deletion and one new API in
`pg_trickle`, plus bootstrapping an entirely new extension repo for `pg_tide`.
The ~6 working day estimate from
[plans/PLAN_RELAY_STANDALONE.md](../plans/PLAN_RELAY_STANDALONE.md) §7.9
covers both repos.

---

*Previous: [v0.45.0 — Operational Readiness, Scalability & CI Completeness](v0.45.0.md)*
*Next: [v0.47.0 — Embedding Pipeline Infrastructure & ANN Maintenance](v0.47.0.md)*
