Read-only Postgres replicas won't stop LLM agents from bloating your primary DB: 4 failure modes
EmetInteractive · reddit · 2026-10-03
A Reddit post explains why giving LLM agents a read-only Postgres replica blocks direct writes but not long-running queries from wrecking primary DB performance, with four failure modes and fixes:
- Replication bloat: long replica queries hold snapshots open; with hotstandbyfeedback = on the primary can't vacuum, causing heavy bloat. Fix: ALTER ROLE agent SET statementtimeout = '30s'.
- Privilege gaps: ALTER DEFAULT PRIVILEGES only covers objects created by the named role; later tables silently return empty results. Fix: use pgreadalldata (Postgres 14+).
- Audit blindspots: behind PgBouncer, pgAudit sees only the DB role, not per-request IDs. Fix: pass and log trace IDs at the app layer.
- Masked view friction: static PII-masked views break real support workflows. Fix: keep masked views for browsing, gate unmasked lookups behind a Case/Ticket-ID tool.
More from coding & agent
- After a Claude Code ban, this dev tried Chinese models — and says none match Opus 5.5 for real work — lxfater · 2026-10-03
- AgentBug-Smith paper: top coding agents fix just 9% of agent harness bugs — rohanpaul_ai · 2026-10-03
- HeyGen open-sources HyperFrames: deterministic HTML-to-MP4 video pipelines with an agent skill pack — lmoroney · 2026-10-03
- Dev says AI-generated work rivals a year of hand-coded engineering time — cnakazawa · 2026-10-03
- mlsubgen: Fully Local Subtitles in 45 Languages With Dual ASR and LLM Reconciliation — Dodgy_Past · 2026-10-03
- TypeSafe AI ships cookbooks: batching questions cuts cost 12.2x and runs 10x faster — hackgoofer · 2026-10-03