
Multiple result sets: How Database Migration Service automates SQL server to PostgreSQL translation
Google Cloud's Database Migration Service (DMS) automates the translation of SQL Server stored procedures to PostgreSQL, specifically handling multiple result sets. It uses a decision matrix to determine whether to convert these into PostgreSQL stored procedures or functions.
Why it matters
This automation removes the need for manual rewrites when migrating large databases with hundreds of complex procedures. Consequently, application and QA engineers must adapt their code to fetch data sequentially using cursors.
The details
- Multi-result sets are converted into PL/pgSQL functions returning a SETOF refcursor.
- DMS uses directed graphs and Depth First Search to analyze procedure call hierarchies.
- PostgreSQL cursors require execution within explicit BEGIN...COMMIT transaction blocks.
Show entities and relationshipsHide entities and relationships
In this article
Key connections
Database Migration Service uses SQL Server
Database Migration Service automates the translation of T-SQL stored procedures from SQL Server.
Database Migration Service uses PostgreSQL
Database Migration Service converts SQL Server database objects into PostgreSQL functions and procedures.
SQL Server competes with PostgreSQL
SQL Server and PostgreSQL are competing relational database management systems.
SQL Server is built with T-SQL
SQL Server uses T-SQL as its procedural database language.
PostgreSQL is built with PL/pgSQL
PostgreSQL uses PL/pgSQL as its procedural language.
Database Migration Service is related to T-SQL
Database Migration Service parses and translates T-SQL stored procedures.
Show 2 more connectionsShow fewer connections
Database Migration Service is related to PL/pgSQL
Database Migration Service outputs translated PL/pgSQL code.
Google owns Database Migration Service
Google offers Database Migration Service as part of Google Cloud.
Get the weekly recap
The stories like this one, picked and explained — once a week, straight to your inbox.