For us (we build business software distributed to customers), the License is the key factor. MySQL/MariaDB is GPL, and even worse, the JDBC driver is also GPL (which makes any business software built on MySQL jdbc driver violate the GPL license). While postgres's license is more permissive.
Just to clarify for others (you probably already know this), the GPL is only an issue if you distribute the binaries for your code. If it's e.g. a typical SaaS then the GPL isn't nearly as scary. The AGPL is problematic in that case though.
Not a licensing lawyer. But with a system like MySQL, which is installed as a service (opposed to a library you link with, like the MySQL Connector for java), most of the GPL triggers if you distribute a modified version to a third party.
Key words there are: Distribute - an employee of your company gives the modified binary to a customer; modified - it's not stock mysql, but you've patched something inside it; and third party - that's some customer outside of your own company or legal entity.
If you distribute an unmodified mysql to your customers, that's fine. If you keep a modified mysql running in your infrastructure only without giving anyone outside your company / legal entity access to the binaries, you're legally fine, but a bit of a jerk (this lead to the whole MongoDB licensing fun against SaaS vendors). Only if you patch MySQL and distribute it, you have to make your changes available.
This makes GPL licensed systems you don't link any code against fairly safe to use.