I saw this article a while ago comparing PostgreSQL to MS SQL server. But I've never used MS SQL server, so I can't judge.
However, I made this list a few months ago in a discussion and I think it answers your question:
These are just some of the reasons I have for using PostgreSQL over MySQL:
- Amazingly excellent quality documentation. MySQL docs are very very bad; sometimes they're simply a disorganized list of miscellaneous notes about a feature.
- Common table expressions and recursive CTEs. In MySQL it's views on views on views.
- Support for subqueries in views. Helps a ton when you want to sort some data before aggregating it inside a view. Again, avoids making unnecessary views on views in MySQL.
- Arrays and a wealth of functions and operators for arrays. Convert arrays to and from rows. Aggregate fields into arrays.
- Set-returning functions. (Exercise: aggregate data from a table, ensuring a row exists for every day from a past date to the current date (even if no data exists for any given day.)
- JSON data type and query operators. Other unstructured data support. Takes care of your craving to use a NoSQL database.
- Network address data type, functions, and operators. I don't always need to store or operate on network addresses, but the prospect of doing so by converting to an integer and doing bitwise arithmetic in a way that does not give me bonehead edge case nightmares is scary.
- Window functions.[2]