Gemini 助力 Database Migration Service 加速 PostgreSQL 迁移
Core Highlights
Google Cloud added Gemini-powered AI-assisted code conversion to Database Migration Service (DMS), which can automatically rewrite stored procedures, triggers, and custom functions from Oracle or SQL Server into PostgreSQL's PL/pgSQL. The most labor-intensive part of migration—procedural code conversion—can now be handed to the model for a first draft, with engineers refining it afterward. For teams that have postponed moving off expensive commercial databases, this removes a major source of dread and a common excuse for staying put. It also turns a manually priced services engagement into a self-serve workflow that finance teams can actually forecast instead of fearing as an open-ended project with no clear end date in sight.
It also shows Google using its model advantage to defend the cloud's most lucrative and sticky legacy enterprise workloads.
What Happened
When enterprises move databases from commercial systems to open-source PostgreSQL, the pain is rarely the table schema but the thousands of stored procedures and triggers that encode years of business logic no one fully documents. DMS's new feature reads source objects, calls Gemini to generate equivalent target code, and preserves the original business logic and comment style so reviewers can trust the translation. Users can compare, edit, and rerun item by item in the console, compressing migration from months to weeks and freeing senior DBAs from copy-paste drudgery. The guided loop keeps a human in authority over every changed line, which is exactly what risk-averse IT organizations require before touching a production system that the business depends on every minute of every day.
Customers in regulated industries say the audit trail of diffs was the exact feature that finally won internal approval to proceed.
Technical Details
Gemini acts as a "translator" here: it understands the syntax differences between T-SQL and PL/SQL, transaction semantics, and built-in function mappings, outputting code that fits PostgreSQL conventions rather than literal copies that would break at runtime. The system also flags uncertain items for human review, so edge cases are surfaced instead of silently mishandled and discovered only after a costly outage in production. Under the hood, it relies on Google's managed execution environment and vector retrieval, using historical migration cases as reference context to raise conversion accuracy on unusual patterns. That retrieval step is what separates a purpose-built migration assistant from a generic model paste into a terminal that has no memory of prior fixes and repeats the same mistakes.
The vector store of past migrations lets the model learn shop-specific idioms that generic rule-based translators tend to miss entirely.
Versus Competitors
AWS's Schema Conversion Tool and Azure's migration assistant also do code conversion but mostly on rule templates, and they tend to error on complex triggers and vendor-specific idioms that fall outside the rulebook. Gemini's generative approach is more flexible with non-standard logic and can infer intent from context instead of matching a pattern that may not exist in the manual. In contrast, Google embeds the capability directly into the managed DMS service, sparing users from orchestrating the model themselves or wiring up a separate inference endpoint and paying for idle capacity. The integration is the differentiator as much as the raw model quality behind it, because buyers value the absence of glue code they would otherwise have to maintain.
Microsoft and AWS are expected to match this quickly, turning migration assist into a baseline expectation rather than a differentiator.
Industry Impact and Use Cases
For customers squeezed by Oracle licensing fees, this is a shot in the arm for "de-Oraclization," lowering both risk and total cost of leaving a vendor that has long held pricing power over its install base. For cloud vendors, AI-assisted migration is becoming a new battlefield for existing enterprise clients who are weighing where to run their databases next. For system integrators, it changes the economics of migration projects from labor-heavy to review-heavy, letting smaller firms compete for bigger jobs they could not staff before. Simply put, the old fear was "procedural code that won't move"; Gemini now chews through most of that hard bone, and the remaining gaps are exactly where expert humans should spend their limited, expensive time rather than on rote translation a model can already handle well.
System integrators worry the tool commoditizes their highest-margin service even as it creates fresh, billable review work.