16 ms·
> If you need a database, don’t use MySQL or MariaDB. Use PostgreSQL. This is stupid. There are pros and cons to every database. For example, MySQL allows you
by chx 8y ago
>
If you need a database, don’t use MySQL or MariaDB. Use PostgreSQL.
This is stupid. There are pros and cons to every database. For example, MySQL allows you to set a trigger on an op, PostgreSQL requires you to write a function first.
- ainar-g 8y agoI agree that that point sounds too rough. I would write something like >Every software has issues; so know your software's gotchas. With that said, the perception I get is that PostgreSQL has less such gotchas and works better "out of the box". Though still not optimally, according to our Ops.
- dijit 8y agoPostgreSQL is pretty good- the default config limits the resource consumption to something you very likely wont want; and things like WAL shipping have some awkward gotchas but it's really stable and quite consistent. People usually argue against postgresql because it used to be slow on multi-core systems, the vacuum was kinda crappy in PGSQL <8.2 and it lacks a lot of features in base (because typically pgsql developers don't accept something in base unless it's very stable and orthogonal, which I consider to be a good thing). It's like the OpenBSD of Databases.
- gmac 8y agoThing A having specific advantages over Thing B in no way implies that Thing B is not clearly superior overall. I have used both MySQL and Postgres, although admittedly I haven't touched MySQL for a few years (the last time I tried to use MySQL for something, I found it would happily serve me up an arbitrary result for a clearly nonsensical query). I thought this comment on an earlier thread summed up my feelings about the two systems rather beautifully: https://news.ycombinator.com/item?id=15173100 https://news.ycombinator.com/item?id=15173100
- neverminder 8y ago> This is stupid. Talk about stupid, run this query on both Mysql and Postgres: select 0 = 'banana'; Make your own conclusion.
- gmac 8y agomysql> select 0 = 'banana'; +--------------+ | 0 = 'banana' | +--------------+ | 1 | +--------------+ 1 row in set, 1 warning (0.00 sec) vs pg# select 0 = 'banana'; ERROR: invalid input syntax for integer: "banana" LINE 1: select 0 = 'banana';
- mmt 8y agoMy conclusion (not just based on this example), is that MySQL favors (initial) ease [1], whereas PostgreSQL favors correctness [2]. To suggest the former approach is "stupid" is to fail to explain how it became so wildly popular. I allege that it is actually brilliant.. marketing. MySQL marketed itself to developers by being not just free, but easy to work with. Need a database? Want to learn SQL? We won't bore you or slow you down with Codd and those pesky rules maaaan. It'll just work! For the vast majority of use cases, it did exactly that. Meanwhile, Postgres was esssentially sending the stodgy, old-fashioned message that databases are a hard problem that require careful up-front consideration so that one doesn't run into problems down the road, be they scale/performance or more severe like (even non-catastrophic) data loss. That this message was, and still is, correct, just isn't very compelling in a rapid-protoyping fail-fast world. Unfortunately for those of us whose job it is to deal with the eventual consequences, it's too late by the time we're brought in [3]. I think we've seen a similar effect with many of the "NoSQL" datastores, as well. They gain initial popularity due to being easy, lightweight, and lightnight fast, but, as they mature and gain real-world use, we see articles that are shocked (shocked!) that there is data loss going on in this establishment and that, yes, if you need certain tedious features (like data integrity) from that stodgy old database world, you'll have to sacrifice that lightning fast performance. [1] aka flexibility [2] aka standards adherence or even pedantry [3] though I've never quite understood the reasoning of why it would be so impractical to move RDBMSes when there's so often an ORM and no MySQL-specific features in use
- Anthony-G 8y agoI've never had the privilege of using PostgreSQL but when using MySQL, I always enable automatic display of warnings (which really should be errors): mysql> \W Show warnings enabled. mysql> select 0 = 'banana'; +--------------+ | 0 = 'banana' | +--------------+ | 1 | +--------------+ 1 row in set, 1 warning (0.00 sec) Warning (Code 1292): Truncated incorrect DOUBLE value: 'banana'
- zkomp 8y agoWhat is so stupid with avoiding the living hell of maintaning crap: silent data truncation, weird inconcistencies or this very issue. If you need a database, why would you ever pick the stupid one..,