Denis Baciu canonical archive · est. 2026

Writing

AI-assisted PostgreSQL migrations need a human review loop

source: linkedinoriginal ↗
published: 2026-08-13 · status: canonical · expanded from the original post
AI-assisted PostgreSQL migrations need a human review loop

Moving a database to PostgreSQL is one of those tasks that looks mechanical until you hit the first stored procedure that uses a vendor-specific quirk. Tables, indexes, and straightforward SQL port over without much drama. Stored procedures are different. They carry business logic, exception paths, and assumptions about how the source database handles transactions and types. Google Cloud now has Gemini inside Database Migration Service, offering AI-generated PL/pgSQL conversions alongside the original source code. In plain English: instead of porting every function by hand, the tool drafts the new syntax for you, and your team reviews it before anything goes live.

The real value isn't just speed, though that matters when you have hundreds of routines to convert. It's that the AI output is placed next to the original code, so engineers can diff the conversion and catch subtle logic changes before deploy. That side-by-side view turns the review from a rewrite exercise into an inspection exercise. For enterprise systems, the review step is non-negotiable. A converted procedure that passes syntax checks but changes transaction behavior is worse than no conversion at all, because it gives a false sense of progress while quietly altering how the system behaves under load or failure.

There's a tension here. Teams under migration deadlines will be tempted to accept these conversions wholesale to hit the date. The generated code often looks plausible, and plausibility is dangerous when the deadline is close. The takeaway is that AI-assisted migration only works if the review loop is baked into the process, not bypassed because the output looks right. I'd treat generated code like a pull request from a very fast junior developer: useful, but accountable. You don't merge it just because it compiles; you read it, ask questions, and check the edge cases.

This shifts where the work happens. Instead of spending hours recalling PL/pgSQL syntax or translating cursor loops, engineers spend that time verifying semantics. That's a better use of senior judgment, but only if organizations protect the time for it. A migration plan that assumes AI output is correct will accumulate risky conversions that no one has really read. The tool is the easy part; the discipline around it is the hard part.

Google's post on the update is worth reading for the details on how the feature works inside Database Migration Service. The underlying point stays the same whether you use Gemini or any other assistant: the fastest conversion is not the one that gets committed first. It's the one that survives review with the same behavior as the original.