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. 

Monday, April 04, 2022

Write Better Code. Be a better programmer!

Write better code — beautiful, explicit, simple, flat, sparse, readable, obvious, unambiguous,  and exception aware code — Be a better programmer.

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

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 ...