Implement the pg-lo engine (ADR-009, POC #7 C1-C7) in src/pg_lo.rs
behind feature pg-lo (default-off), plus the shared-helper home the
task's design points resolve into src/pg_common.rs.
- Engine: seven Backend methods + put_staged; the lo_entries companion
table is the contract authority (list/size/has/CAS table-level;
pg_largeobject read only by the orphan sweep's candidate enumeration);
one-tx puts with 512 KiB lowrite statements (LOWRITE_CHUNK, the C2
knee), the descriptorless lo_get window cursor (READ_CHUNK; EOF
clamping + the unexpected-EOF clean failure), the held-tx staging
cursor aggregating 64 KiB windows, one-tx deletes, the complete
single-snapshot list, the 42P01 read-only virgin-store split, and the
crate-internal reap_orphans (scope-noted, planted-orphan contract
test). Posture deltas in the module doc (catalog space never
returned / VACUUM FULL runbook line / autovacuum inherited / the
cached-get capacity facts). Nothing of EngineFleetState; the window
family remains engine-pg-lo-window.
- Shared helpers (pg_err, 42P01, quote_identifier, size clamp, i64-nanos
encoding, build_pool, PgOpts, test janitors) move to src/pg_common.rs
gated cfg(any(postgres, pg-lo)); PgOpts's public re-export widens
(definition moved; crate::postgres::PgOpts path held by re-export);
src/postgres.rs's changes are mechanical swaps.
- LO isolation (C7 lesson): per-test dedicated databases + DatabaseJanitor
(WITH (FORCE)); zero LO/schema/database residue on the shared harness
db (pre-existing public.lo_entries exploration residue found and
removed).
- 18 in-module tests, env-driven (ALKBLOBS_PG_*), skipping cleanly
server-less; all green against the pglo-poc harness server.
Verified: cargo test (69/19/3), --features pg-lo live (87/19/3, 18/18
pg-lo), --features postgres live (103/36/3), --all-features (176/71/4);
clippy -D warnings green for default, pg-lo, postgres, all-features,
--no-default-features --features "pg-lo,mem" and "postgres,pg-lo";
cargo fmt --check; cargo doc --no-deps.