Radim Marek: Don't Let Your AI Touch Production

Radim Marek: Don't Let Your AI Touch Production

Planet PostgreSQL
Planet PostgreSQLApr 6, 2026

Companies Mentioned

Why It Matters

Without schema‑aware validation, AI‑generated queries can degrade performance, cause outages, or introduce security risks, threatening database reliability and business continuity.

Key Takeaways

  • AI SQL often syntactically correct but ignores execution impact
  • Production schema snapshots give AI agents necessary context
  • dryrun captures PostgreSQL metadata into JSON for offline use
  • MCP lets AI query schema without live DB connection
  • Automated schema snapshots prevent stale data and migration errors

Pulse Analysis

The rise of generative AI in software development has turned SQL generation into a new frontier of productivity, yet the technology still treats databases as black boxes. Models such as Claude Code can produce syntactically flawless statements, but they lack insight into lock granularity, index usage, or the cost of full‑table rewrites. Recent high‑profile failures—like the July 2025 incident where an AI tool wiped a production database during a code freeze—highlight that plausibility is not a performance metric. Enterprises that rely on AI‑driven code must therefore embed deeper database intelligence to avoid silent performance regressions and catastrophic data loss.

Marek’s dryrun addresses this gap by extracting the full PostgreSQL catalog, statistics, and comments into a compact JSON file that can be version‑controlled alongside application code. The snapshot includes table row counts, index definitions, histogram data, and even semantic comments, giving AI agents a deterministic view of the production environment without exposing live credentials. When paired with the Model Context Protocol (MCP), dryrun turns these static files into callable tools—check_migration, suggest_index, validate_query, and lint_schema—allowing AI assistants to evaluate lock impact, recommend partial indexes, and flag anti‑patterns before any statement reaches the database. This offline‑first approach reduces risk, speeds up developer feedback loops, and eliminates the need for ad‑hoc database connections in CI pipelines.

Looking ahead, the dryrun ecosystem is poised to become a standard safety gate for AI‑augmented development. Upcoming features like Shadow EXPLAIN will inject production statistics into local PostgreSQL instances, delivering realistic execution plans without moving data. A CI/CD Trust Gate will bundle migration safety checks, schema diffing, and linting into a single command, automating compliance and preventing unsafe changes from merging. As more organizations adopt AI assistants, tools that provide deterministic, schema‑aware context will be essential for maintaining performance, security, and operational stability across modern data stacks.

Radim Marek: Don't let your AI touch production

Comments

Want to join the conversation?

Loading comments...