r/SQLServer • u/Ohgogh • Jan 12 '26
Discussion Migrating from Microsoft SQL server to Postgres
My team and I are currently working with an MSSQL database and now have the opportunity to migrate to PostgreSQL. Would you recommend making the switch?
For context:
- ~100GB of data
- Heavy use of recursive queries (we have recursive relationships between tables)
- Using an ORM
Edit note: Forget to mention is that I have json objects that I save In a column. Now I do not query this but post great has a better interface for dealing with json with the Jsonb.
Based on this, I'd love to hear your experiences and feedback. Thanks!
24
Upvotes
31
u/alinroc 4 Jan 12 '26
What problem(s) for the business would be solved by making this switch? "Because we can, and it's shiny" isn't a great business justification.
Do you have DBAs and infrastructure admins who can support PostGres?
Are there other systems that depend upon your data which will be disrupted by this change?
Has there been any analysis of the total cost of switching and ownership?
"We use an ORM" does not completely insulate you from the RDBMS and depending upon how you use it may result in additional necessary changes.
If you're just using it as storage for data formatted as JSON, then is this an advantage over SQL Server? If you're not going to use the feature/interface, then you can pretend it's not there. BTW, you should take a look at the new JSON features in SQL Server 2025.
20
u/downshiftdata Jan 12 '26
Are you a bunch of Postgres experts with only middling SQL Server knowledge and saddled with a SQL Server database? If so, sure. Otherwise, don't.
ProTip: It's not the platform. It's almost never the platform.
5
u/andrea_ci 1 Jan 12 '26
no, absolutely not, based on what you said.
what's the reason of considering the switch?
5
u/ExtraordinaryKaylee Jan 12 '26
They're both incredibly capable systems, with the right admins and developers.
I prefer the development flexibility PostgreSQL offers over top of MSSQL at this point, but you need some pretty advanced DBAs to take advantage of the specifics.
If you're purely talking the OLTP/OLAP workload (because PostgreSQL does not include ETL tools) Ultimately, it comes down to a manpower/hiring decision: Which one can you support easier/better in your environment, and can you get the right staff to manage/develop in it.
The JSON support in Postgres is incredible, including the ability to create indexes on data inside the json object should that be useful.
6
u/IndependentTrouble62 Jan 12 '26
Are you currently using Columnstore Indexes? PostGres does not natively support the index time. You will need an extension like moonpg. PostGres in this realm really isnt on par with SQL Servers Implementation.
Are you using SSIS for ETL? You will likely need to rewrite them or puchase a license to add the needed source / destination connectors.
What are the benefits of migrating? Is there an issue with SQL Server? If the answer to these questions is not really great dont migrate just to migrate. Its a massive PITA, adds risk, and will likely require some level of retraining for staff.
14
u/salva922 Jan 12 '26
Mssql > postgres
5
u/Ok_Carpet_9510 Jan 12 '26
What is the problem? Cost, performance..?
5
u/TBTSyncro Jan 12 '26
what is the problem you are trying to solve......
4
u/elevarq Jan 12 '26
What problem should this migration solve?
If you don’t have one, despite my love for PostgreSQL, I wouldn’t recommend a migration.
6
u/Eleventhousand Jan 12 '26
Without knowing more than just what you said, I would not recommend doing it. It seems like a lot of rework for little to no benefit.
3
u/dgillz Jan 12 '26
Why? What is the benefit?
3
u/Snoo_61639 Jan 13 '26
Don't fix what is not broken
Better have a new project and start it on Postgres from scratch rather than migrating what is fully functional on SQL Server.
1
u/jfrazierjr Jan 12 '26
I have mixed feelings having worked with mssql for 25 years.
On the one hand you save money. One the other hand case sensitive erg...
1
u/drunkadvice Jan 12 '26
It’s not going to be “point the server to Postgres now”. It will involve account for data types, re-coding the database stored procs, modifying any external code that queries the data, performance testing and indexes to ensure the Postgres engine doesn’t choke, and regression testing every part of code that interacts with SQL. You’re changing the engine on a semi while it’s driving down the highway.
So much regression testing, I might go have a beer thinking about how happy I am it’s not me. I wish you luck!
1
u/elkazz Jan 13 '26
What answer are you expecting asking this on a SQL Server sub?
1
u/Codeman119 Jan 13 '26
As long as you have done the research and you think that they solution will serve you better then by all means go ahead. Just be careful because I’m sure that you were gonna try to use AI to convert scripts and stuff from sequel server over to Postgres as we all know, we can make mistakes, but it will do a lot of the typing for you. Just make sure you review and run it.
1
u/balrob83 Jan 13 '26
I have read the explanation for the transition and I think that now is not the moment. You have to invest time to do the transition and also downtime for the data movement in the D day. I expect something more mandatory like licensing costs decrease or the company discontinuing SQL server. Only there is a new guy in the Office(postgres) is not enough, tomorrow It Will be mongodb and other day a cloud database. The companies continue working with for example informix because It isn't so easy to switch between rdbms.
1
u/thegreenmushrooms Jan 22 '26
late to the party, but the benefit you get with mssql is largely the integration with other tools.
if you're doing anything operational I would say you don't need MSSQL and it's cleaner with pg. you're missing some features, but many have a workaround in the ORM. even for analytical work, where the DB takes place of the dataset engine, the features are only as expressive as the ORM—for our company it's dbt. dbt plays much nicer with pg than it does with MSSQL. no one likes working with off-row text storage either, the performance cost is high compared to JSONB.
so unless you have an ecosystem that relies on MSSQL I would stay away from it.
the swiss army capability of MSSQL with built in analytics engine, scheduler is outclassed by tools that specifically do those things. there is an argument for MSSQL just working 95% of the time, but dedicated tooling is still more robust
1
u/slotix Apr 06 '26
Most replies are already pointing to the real question: what problem are you actually solving?
From your description:
- 100GB isn’t large for either system
- recursive queries are fine in both
- ORM reduces differences (but doesn’t remove them)
- JSON is nicer in Postgres, but not really a migration driver on its own
So this doesn’t sound like a technical need, more like an organizational one (“we now support Postgres”).
In that case the tradeoff is simple:
you pay the migration cost (schema changes, queries, testing, edge cases, tooling),
and in return you need a clear benefit.
Unless that benefit is obvious (cost, scaling limits, team expertise, ecosystem), you’re basically rewriting a working system for optional gains.
That’s rarely worth it.
0
u/killit Jan 12 '26
I'm not overly familiar with postgres, but wouldn't this be a pretty big downgrade unless you definitely don't need any of the extra benefits of sql server, and the cost of it is a problem for your company? AFAIK sql server is a much bigger, more feature rich and rounded platform than anything postgres can hope to come close to. I don't doubt postgres has a few advantages, but for the most part, it's pretty basic by comparison.
-5
u/thinkingatoms Jan 12 '26 edited Jan 12 '26
100% switch
a lot of enterprise features are free in postgresql, such as online index creation. make sure you set up postgresql to be case sensitive
edit: post in r/database or something neutral for real answers