PostgreSQL Memory Plan

Default local memory backend for Clawdie: PostgreSQL 18 in a dedicated FreeBSD jail named db.

Database: PostgreSQL 18

Jail: db (db.clawdie.si)

Provisioning: thick jail

Default network: shared

Optional later network: VNET

Role: future long-term memory backend

Deferred: pgvector, schema design, embeddings, REST API layer

Why this option

Decision: start with plain PostgreSQL 18 and prove service health first. Vector embeddings are deferred until the base service is stable.

Install-time choices

Recommended first-install profile: shared network, minimal resources, and empty database initialization.

Install plan

  1. Create or prepare a persistent jail named db.
  2. Install postgresql18-server and postgresql18-client.
  3. Enable PostgreSQL in jail rc.conf.
  4. Run service postgresql initdb.
  5. Start PostgreSQL.
  6. Validate local access with psql.
  7. Snapshot before schema and before pgvector.

Thick vs Thin

Baseline resources

Restore path

  1. Create jail.
  2. Install PostgreSQL 18.
  3. Initialize cluster.
  4. Optionally restore from .sql or custom dump.
  5. Validate local access.
  6. Snapshot.

Expected commands

sudo jexec db /bin/sh -lc 'pkg install -y postgresql18-server postgresql18-client'
sudo jexec db /bin/sh -lc 'sysrc postgresql_enable=YES'
sudo jexec db /bin/sh -lc 'service postgresql initdb'
sudo jexec db /bin/sh -lc 'service postgresql start'
sudo jexec db /bin/sh -lc 'psql -U postgres -d postgres -c "select version();"'

Current Proven State

Now proven on the FreeBSD host: the db jail can be created as a thick VNET jail on warden0 with the explicit gateway flag. The canonical create path is:

sudo bastille create -T -B -g 10.0.0.1 db 15.0-RELEASE 10.0.0.2/24 warden0
sudo bastille create -T -B -g 10.0.0.1 db 15.0-RELEASE 10.0.0.2/24 warden0
sudo bastille config db set host.hostname db.clawdie.si
sudo bastille restart db
sudo jexec db /bin/sh -c 'hostname && ifconfig && netstat -rn'
Important: if the jail comes up with the correct IP but no default route, that is a provisioning defect. The fix is the explicit gateway flag -g 10.0.0.1, not a manual route added after the fact.

ZFS notes

Snapshot points

Use this naming baseline:

-DD-mon-YYYY-HHMMSS

Fixed month abbreviations: jan feb mar apr maj jun jul avg sep okt nov dec

Not in scope yet: copying the old v2 Supabase shell scripts directly. Those are reference material, not the first implementation target for Clawdie.