Why PostgreSQL
PostgreSQL is open source, has no licence costs and is available as a managed service on every large cloud: Amazon RDS and Aurora, Azure Database for PostgreSQL Flexible Server, Google Cloud SQL and AlloyDB. You can also run it on your own server. Choose a recent major version: PostgreSQL 13 and 14 have reached their community end of life (14 on 12 November 2026), so 17 or 18 is a sensible target.
From SQL Server: the main differences
- Case sensitivity: SQL Server usually compares text case-insensitively; PostgreSQL compares case-sensitively. Use nondeterministic ICU collations or the citext type where the application relies on it.
- Identifiers: PostgreSQL turns unquoted names into lower case and limits names to 63 characters. Mixed-case names and long names need attention.
- Data types:
money,sql_variant,hierarchyid,datetimeanduniqueidentifierhave no exact equivalent or behave differently. - Tables and triggers: temporal (system-versioned) tables do not exist;
INSTEAD OFtriggers only work on views; computed columns become generated columns. - Procedural code: T-SQL becomes PL/pgSQL. Cursors,
MERGEwithOUTPUT, dynamic SQL, table types andTOPall need rewriting. - Columnstore indexes and filtered indexes need a different approach.
From Oracle: the main differences
- Empty strings: Oracle treats an empty string as NULL, PostgreSQL does not. This silently changes the results of comparisons and constraints.
- Identifiers: Oracle turns unquoted names into upper case, PostgreSQL into lower case.
- Data types:
NUMBERbecomesnumeric,integerorbigint;VARCHAR2becomesvarchar; OracleDATEincludes a time and maps totimestamp. - Packages: PostgreSQL has no packages. Package procedures become functions or procedures in a schema; package variables need another solution.
- SQL dialect:
CONNECT BYbecomes a recursive query,ROWNUMbecomesLIMITor a window function, synonyms and autonomous transactions need alternatives.
Tools that help
Tools convert most of the structure and move the data; the procedural code nearly always needs manual work and testing.
- pgloader and sqlserver2pgsql for SQL Server; ora2pg for Oracle
- AWS DMS Schema Conversion and AWS DMS for migrations to Amazon RDS or Aurora
- Database Migration Service on Google Cloud for Cloud SQL and AlloyDB
- Debezium change data capture to keep the new database in sync until the switch-over
Estimating the work
The effort depends less on the size of the data than on the number of procedures, functions, triggers and views, and on which features they use. A database with a thousand simple tables and little code can be easier than one with fifty tables and two hundred stored procedures. Count those objects, list the features they use, and you have a realistic basis for a plan.
Test with a copy of production data: subtle differences such as empty strings, rounding of numeric types and case-sensitive comparisons only show up with real data.
How the free scan helps
The scan has read-only scripts for SQL Server and Oracle that collect the structure, never the data or the code text. Paste the result, choose PostgreSQL on your own server or one of the managed services as the target, and see the objects that need conversion, grouped by type, with a score. The analysis runs entirely in your browser.
Questions
Which PostgreSQL version should I migrate to?
A recent major version: PostgreSQL 17 or 18. Managed services support 14 to 18; PostgreSQL 13 and 14 are already out of community support.
Can my application keep using T-SQL?
Only through Babelfish on Amazon Aurora PostgreSQL. On every other PostgreSQL platform, T-SQL code has to be rewritten in PL/pgSQL or moved to the application.
How long does a migration to PostgreSQL take?
That depends mainly on the amount of procedural code and the features it uses, not on the size of the data. An inventory of the objects gives a much better estimate than a general rule.
Is my data safe during the scan?
The script only reads the catalog of the database: names, types and which features the code uses. It reads no table data, and the result is analysed in your browser without being uploaded.
Find out how much of your SQL Server or Oracle database needs conversion for PostgreSQL: run the read-only script, paste the result and pick your PostgreSQL target. Free, and nothing is uploaded.
Start the free scan