Comment by jiggawatts

1 month ago

> from MSSQL to Postgres

How's that going? Any lessons learnt you'd be willing to share?

Differences: Money/decimals, rounding, case-sensitivity, equality comparisons differences, db/table locks mechanisms, memory/worker management, table/column naming conventions, null fields/columns effects on queries.

Mmm what else. I prefer postgres so I'm very excited about this. So many foot-guns will no longer haunt us like on MSSQL and less db/table locks to try solve (pessimistic vs optimistic locks). Oh and we are going to save a gross amount of money per year, as we will also be able to switch off a couple of Windows Server VM's in the process. These puppies are costing us a ton (I think about half of our infra bill are licenses...).

Just create a branch, spin up a test db and try to port a small feature. Its very easy in most cases. Debian + dotnet + postgres = dream team.

If you only use MSSQL as a datastore, it's not too bad. If you used all the other features (MSAS/SSIS/etc...), it is much harder. PG also isn't a panacea - you're trading one set of issues for another. The biggest upside is that it's much less expensive :)

MSSQL query optimizer is one of the best available. If you have truly insane queries, views needing joins on views and CTEs, etc, you might be surprised at how well SQL Server was handling them versus PostgreSQL.

  • This is my biggest worry, especially since PostgreSQL uses "process per connection" and generally doesn't seem to cache query plans...