Blog

Notes from the bulwark

Migrations, locks, credentials, and what changes when an agent writes the SQL. Follow along with the Atom or RSS feed.

·3 min read

Adding a foreign key to a big table without locking both of them

A plain ADD CONSTRAINT ... FOREIGN KEY validates every row while holding locks on the child and the parent. The NOT VALID and VALIDATE split that avoids it, the index nobody adds, and why the same trick works for CHECK and NOT NULL.

postgres
migrations
foreign-keys
locks
·5 min read

What 40 agent-written migrations got wrong

We asked a coding agent for forty ordinary Postgres migrations and ran the free rule set over the result. Twenty-seven were flagged. The pattern in what it got right and wrong is more interesting than the count.

ai-workflows
postgres
migrations
data
·4 min read

Vibe coding without being reckless

Letting the model drive is fine. Letting it drive into production without a gate is not. A short, practical split between the parts of a change you can vibe and the parts that need a deterministic check.

ai-workflows
vibe-coding
migrations
credentials
·4 min read

Deterministic checks for AI-written migrations

Coding agents write database migrations quickly and confidently, and the mistakes they make are the same ones people make. Why the check that catches them has to be a rule, not another model.

ai-workflows
postgres
migrations