by stephenr · 9y ago · 0 comments
You can write a function in python (or a number of other languages) and share code with your application, and use those functions almost anywhere in postgres (including unique indexes). That makes the unique indexes much more powerful, especially if you want to adapt to changes without rewriting all your data.
Or, you can use range types and an exclusion constraint to form a non-overlapping constraint that prevents schedule conflicts:
https://www.postgresql.org/docs/10/static/rangetypes.html
There are tons of examples and others list them all the time. The problem is that a lot of people read past them because they don't see why semantics matter.
My point was that you admitted a single argument won't convince everyone that database semantics matter, and then went on to list two features that MySQL handles just fine, regardless of how well it handles the other things you care about.
You may as well have said "a pet badger is better than a pet bulldog in so many ways, for example it will attack/chase home invaders".
Edit: I have no actual idea if you can have a badger for a pet, or how effective they really are at home protection but I imagine they'd be badass at it.
If you get my point but find flaws in my argument, well, I can live with that. Counterpoints welcome.