What's new in PostgreSQL 9.0 - a User's Perspective
wiki.postgresql.org
wiki.postgresql.org
It's been a long wait but replication is now finally as easy as it gets. And, by design, it can not silently lose or corrupt data. Unlike a certain other popular RDBMS.
For my part, I'm stoked about 9.0. It can't get here soon enough.
Well, to clarify, a lot of popular pre-packaged software is out there in PHP. And PHP never had a good db abstraction layer + the entire style of the PHP language lent itself to the direct use of queries in the code, and the direct usage of the MySQL connectors.
When users want a forum, a wiki, a helpdesk, a blog, etc. and it's in PHP, chances are it doesn't have a PostgreSQL backend. And if you have to have MySQL, and MySQL works for everything (for some definition of the word "works") while PostgreSQL doesn't... there's your answer.
The real reason is: PostgreSQL doesn't have any must-have apps that only run PGSQL (which is a good thing), and MySQL does (which is a bad thing) so MySQL wins.
- Postgres for Django and custom Perl system.
- MySql for all the 3rd party crap WP, forums, Redmine, couple craptistically old Perl help ticket and project management systems.
We do the same at my work too, but we have less third party apps that require MySQL.
However, only some sites use it and big projects like Wordpress seem to be totally oblivious to it.
Most widely used blog engine (CMS?) in the world - only MySQL. http://codex.wordpress.org/Using_Alternative_Databases
Drupal is probably one of the few PHP CMS that work with PG - http://geek.joshwaihi.com/content/drupal-7-postgresql-suppor...
So it's not worth the trouble to use PostgreSQL in most cases, you'll eventually want to install some extension that only supports MySQL, or get tired of reading documentation that assumes MySQL etc.
I've done the 'apt-get install postgresql' routine a few times, and started to play with it, but due to it being different enough, and without any compelling motivation, I've never been able to learn it beyond scratching the surface.
That said, I'm a developer, and not a DB admin, so the limitation is almost certainly mine.
If by accident you put Latin 1 (or any other non-utf-8-data) into a database that is configured as UTF8, MySQL will go ahead and cut off your data at the first byte with the 8th bit set. No error. No warning. The data is just gone. The only way to find out this happened is by reading back after every write - something I don't want to have to do.
Or allowing to
alter table whatever add somecolumn text not null;
that succeeds and consequently sets every row of somecolumn to NULL, violating the constraint.Or inserting strings longer than allowed by the datatype which MySQL doesn't complain about but just truncates them - another case of having to read and compare the data just stored.
And don't get me started about corrupt on disk data, leading to unreadable tables. But worse - mysqldump at least once exited with an exit code of 0 even though it failed to read one of these corrupt tables. What's worse: It stopped the dumping process and didn't dump any tables and even databases following the corrupt table - yeah. I thought I backed up, but in fact I didn't.
Stuff like this must not happen with a database.
Stuff like this never happened to me with PostgreSQL.
It might be harder to set up. It might feel a bit foreign at first. It might provide features you think you don't need. But at least it doesn't destroy data I entrusted it with.
edit: Also see the rant on my blog I posted when I ran into the UTF8-problem: http://www.gnegg.ch/2008/02/failing-silently-is-bad/
How much are you inclined to trust this mode which was bolted on as an afterthought, though?
I'm maintaining a bunch of MySQL installs for customers and the amount of random failures I've seen even with InnoDB and strict mode during backup/restore and upgrades is just not funny.
Obscure second guesses during even a minor version upgrade are the rule rather than the exception. 'mysql_upgrade' hardly ever worked right for me at first try. A straightforward dump/restore is not an option either because they change the schema of the system tables all the time (which, to add insult to injury, are still MyISAM).
Then you also frequently bump into gems like the following:
Incompatible change: As of MySQL 5.5.3, the server includes dtoa, a library for conversion between strings and numbers by David M. Gay. In MySQL, this library provides the basis for improved conversion between string or DECIMAL values and approximate-value (FLOAT/DOUBLE) numbers.
Because the conversions produced by this library differ in some cases from previous results, the potential exists for incompatibilities in applications that rely on previous results. For example, applications that depend on a specific exact result from previous conversions might need adjustment to accommodate additional precision. (From: http://dev.mysql.com/doc/refman/5.5/en/upgrading-from-previo...)
Oh, and don't get me started on what they call "replication", which will happily, silently desync or corrupt data in various situations.
So well, yeah. Perhaps strict mode indeed works right in all cases. Perhaps.
Its success was due to illusion of simplicity and easiness + massive community of believers ^_^
PostreSQL sites is rather shy comparing to them.
Yes, but how can you put those in the same bucket with MySQL's?
http://dev.mysql.com/doc/refman/5.5/en/mysqldump.html vs http://www.postgresql.org/docs/current/static/app-pgdump.htm...
Note how half the page of the mysqldump docs is spent explaining the braindead semantics and dangerous interaction between --opt* and pretty much everything else.
Moreover the MySQL docs generally read as if they were written by a monkey with ADD:
mysqldump can retrieve and dump table contents row by row, or it can retrieve the entire content from a table and buffer it in memory before dumping it. Buffering in memory can be a problem if you are dumping large tables. To dump tables row by row, use the --quick option (or --opt, which enables --quick). The --opt option (and hence --quick) is enabled by default, so to enable memory buffering, use --skip-quick.
This is frankly just a random example from recent memory. Compare any two pages and you get similar results.
I agree. PG is becoming better and better with every release. It can compete with Oracle in some applications. Personally I hope they implement Row Level Security some time. It's my favorite feature in Oracle and I hope they will implement something similar soon.
Please do your homework before spreading FUD. PostgreSQL is used at large scale every day, e.g. at Skype: http://highscalability.com/skype-plans-postgresql-scale-1-bi...
More examples can be found here: http://www.postgresql.org/about/users
Yes, you are wrong.
Thank you, everyone behind the development of PostgreSQL. I wouldn't be in my life where I am now if it wasn't for the work you are constantly putting into this wonderful project.
And when one thinks "now. this is it. it can't get any better now", you come out with another high-quality release.
Thank you ever so much.
MySQL's working on this (http://mysql.com/oem/), but I've read that PostgreSQL is way too tied to their multi-process network architecture for this to be feasible. But I'd love to be shown to wrong on that.
The important part is that you'd be able to easily statically link to it and handle permissions on a by-file basis, instead of PostgreSQL's current permission model. For all intents and purposes it'd be a larger SQLite replacement then.
I don't know how they manage it, but every release adds features and becomes more stable. Pretty awesome job.
A very high quality product, indeed.
Setting "synchronous_commit = off" nets you 99.9% of the performance improvement without the possibility of corrupting your entire database.
http://www.flickr.com/photos/gavinmroy/4638958958/
And the presentation it came from: