r/programming • • Sep 24 '20

PostgreSQL 13 Released!

https://www.postgresql.org/about/news/2077/
1.3k Upvotes

236 comments sorted by

View all comments

60

u/tomma5o Sep 24 '20 edited Sep 24 '20

Sorry FE dev here, why you guys prefer postgreSQL over mySQL?

15

u/baryluk Sep 24 '20 edited Sep 24 '20

PostgreSQl is know for ita reliability and stability. I lost some databases in mysql installs. Never again.

PoatgreSQL is in general more advanced and customisable. There are various extensions you can write to add new types, indexes, aggregates, helpers, etc. You can do advanced partitioning natively, more advanced indexes, perform very complex analytics queries more performant, while the database is still working with other clients. Use more advanced authentication methods. Trigger , scripting and stored procedures are more advanced. Error handling in data and queries is handled more reliably. Mysql will sometime accept nonsense , conver to something and loss user data without notifying you. Granted it is documented for mysql, but still a shitty design. A lot of these features were available in PoatgreSQL years or decades ago, and mysql is catching up a bit. Making reliable database backups is somehow easier with PostgreSQL. And probably many more, like advanced aggregates, parallel queries, etc. Better and more advanced transaction control support. Historically PostgreSQL provided more advanced and flexible replication support. Also historically mysql was not ACID, making it almost useless for serious database work.

Mysql is popular because it is easier to setup initially, and was super easy to use from php, which lead to its popularity. Also myths of PostgreSQL being slow. In my expirience under real complex conditions, properly configured and used, with comparable functionality, PostgreSQL is faster. But that depends on application and requirements.