Moving a .NET application from SQL Server to PostgreSQL on RDS
The same 4-vCPU Multi-AZ database costs $1,349 a month on SQL Server Standard, $2,094 on Enterprise and $698 on PostgreSQL. Most of the migration work for a .NET codebase is in the T-SQL outside the ORM.
A SQL Server database on RDS pays for three things PostgreSQL doesn't: the SQL Server licence, the Windows licence, and x86, because RDS for SQL Server has no Graviton classes.
For one 4-vCPU Multi-AZ database in us-east-1 the list prices are:
| Engine | Class | Per month | Per year |
|---|---|---|---|
| SQL Server Enterprise | db.r7i.xlarge | $2,093.64 | $25,124 |
| SQL Server Standard | db.r7i.xlarge | $1,349.04 | $16,188 |
| PostgreSQL | db.r8g.xlarge | $697.88 | $8,375 |
Moving from Standard saves $7,814 a year on this one database, and from Enterprise $16,749. Storage and backups cost the same on both sides, so I've left them out.
The saving is easy to calculate. The cost of getting there depends almost entirely on how much T-SQL the application has outside the ORM.
What carries over
If the application uses Entity Framework Core and keeps its queries in LINQ, most of the data layer moves by changing the provider from Microsoft.EntityFrameworkCore.SqlServer to Npgsql.EntityFrameworkCore.PostgreSQL. The entity classes and the LINQ stay as they are.
Migrations don't carry over. They contain SQL Server column types, so you generate a fresh initial migration against PostgreSQL and keep the old ones for history.
Where the work is
Stored procedures, functions and triggers are T-SQL and have to be rewritten in PL/pgSQL. AWS Schema Conversion Tool and DMS Schema Conversion translate the simple ones and flag the rest. The flagged list is your real estimate.
Raw SQL in the application is the second place. Search the codebase for FromSqlRaw, ExecuteSqlRaw, SqlCommand and Dapper calls. Each one may contain TOP, GETDATE(), ISNULL, NOLOCK hints or bracketed identifiers, and none of those run on PostgreSQL.
Then there are differences in behaviour that compile fine and fail in production:
- String comparison is case sensitive by default in PostgreSQL. SQL Server's default collation is not. A login lookup that matched
Anna@andanna@will stop matching. - Unquoted identifiers fold to lower case, so decide on a naming convention before the first migration.
- Npgsql maps
DateTimetotimestamp with time zoneand expects UTC. Code that stores local times needs a decision about time zones first. - SQL Server Agent jobs have no direct equivalent. They become
pg_cronjobs or scheduled tasks outside the database. - SSRS and SSIS don't exist on PostgreSQL. If reports or packages run on the instance, they need a new home.
How to size it before you start
Count four things: stored procedures and functions, raw SQL call sites, Agent jobs, and anything using SSRS or SSIS. An application with a few dozen procedures and EF Core everywhere else is a project of weeks. An application whose business logic lives in two thousand procedures is a different decision, and the licence saving has to be weighed against a rewrite.
For the second kind, Babelfish for Aurora PostgreSQL is worth a test. It accepts T-SQL over the SQL Server protocol, so the application keeps its driver and much of its SQL. It runs only on Aurora and doesn't cover all of T-SQL, so run its compatibility assessment against your schema first.
Moving the data
AWS DMS copies the data and then replicates changes, so the old and new databases stay in sync until you switch. The cutover is a connection string change and a short write freeze. Keep the SQL Server instance for a week or two after, stopped or scaled down, until you're sure.
Before you commit
Don't buy a Reserved Instance for the SQL Server database while this is on the table. The reservation is tied to the engine and edition and keeps billing after the database is gone. I described that in Rightsizing theatre. If the migration is a year away, the edition is still worth checking now, as in Standard vs Enterprise on RDS.
Prices above are AWS list prices for us-east-1, on demand, November 2026.
If you know the SQL Server line is large and don't know how big the migration would be, that's where an audit starts.
Short answers
How much cheaper is RDS for PostgreSQL than RDS for SQL Server?
On list prices in us-east-1, a 4-vCPU Multi-AZ database is $1,349 a month on SQL Server Standard (db.r7i.xlarge) and $698 on PostgreSQL (db.r8g.xlarge), which is 48% less. Against SQL Server Enterprise at $2,094 a month it is 67% less.
Does Entity Framework Core work with PostgreSQL?
Yes. The Npgsql provider replaces the SQL Server provider. LINQ queries carry over. Migrations have to be regenerated, and raw SQL, stored procedures and anything written in T-SQL have to be rewritten.
What is Babelfish?
Babelfish for Aurora PostgreSQL lets an Aurora PostgreSQL cluster accept T-SQL over the SQL Server wire protocol, so an application can keep its SQL Server driver. It exists only on Aurora, and it does not support every T-SQL feature.