Wednesday, November 02, 2022

10 Take-aways Moving MSSQL to PostgreSQL

Background: Based on my recent project, here are the 10 takeaways of MS SQL Server to PostgreSQL migration.
  1. Save the operating cost on SQL Server license. 
  2. PGSQL is case sensitive on char comparison. MSSQL is not case-sensitive. Therefore, the where clauses need to be reviewed in Entity Frameworks (EF). However, Entity Frameworks schema mapping is not case sensitive for C# property names on column names. 
  3. PGSQL supports uuid, which is the same as UniqueIdentifier in SQL Server.
  4. PGSQL timestamp without time zone can be used in MSSQL datetime.
  5. PGSQL 'RAISE NOTICE' equals to MSSQL 'PRINT'.
  6. PGSQL support the data type record. I found this very useful in the migration scripts.  (for loop)
  7. PGSQL block supports transaction. (do $$ ... $$) 
  8. PGSQL is very strict on semi-colon (;) for the statement ending.
  9. PGSQL doesn't support table variable.You need to used temp table instead. (temp table)
  10. DBeaver is very useful universal database management tool. 

Thumbs Up to GitHub Copilot and JetBrains Resharper

Having used AI tool GitHub Copilot since 08/16/2023, I’ve realized that learning GitHub Copilot is like learning a new framework or library ...