mysql> SELECT 3/5; -> 0.60To be honest, I can't fault MySQL for this behavior. It falls in line with the MySQL mantra of make it easy, not "necessarily" correct. A division of 3/5 in a numeric or float would return 0.60. It makes the math easy and normal human consumable.
PostgreSQL and Python on the other hand would give you this:
postgres=# select 3/5; ?column? ---------- 0 (1 row) Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 3/5; 0 >>>To get the similar human consumable response you would want:
postgres=# select 3/5.0; ?column? ------------------------ 0.60000000000000000000 (1 row) Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 3/5.0; 0.59999999999999998Python is using float versus numeric here which explains the disparity. However, MySQL does do something that violates a very basic, as in elementary school math mistake. MySQL defines division by zero as NULL. Yes, you read that correctly.
mysql> SELECT 102/(1-1); -> NULLWhat should happen is:
postgres=# select 102/(1-1); ERROR: division by zero >>> 102/(1-1); Traceback (most recent call last): File "That's correct, an ERROR or EXCEPTION 1. http://dev.mysql.com/doc/refman/5.0/en/arithmetic-functions.html#operator_divide 2. http://en.wikipedia.org/wiki/Division_by_zero
", line 1, in ZeroDivisionError: integer division or modulo by zero
Today, we put our money where our rather obnoxious mouth is and became a benefactor (at the tune of 1k). So with that, step up people. Don't you want to be able to do this:
pgxn --install py-postgresqlInstead of downloading, compiling, finding missing dependencies, screwing around for an hour doing nothing but swearing at the fact that you don't have what you need to use Python + PostgreSQL? No. You don't want to do that. You want to donate to PGXN, so you don't have to.
Oracle owns another fairly well known Open Source database, BerkeleyDB. The pricing for BerkeleyDB. suggests that MySQL may be in for a culture shock. MySQL appears to have removed their support pricing from its website (a move that should not provide comfort to any customer) but as I recall (please correct me if I am wrong) it used to be anywhere from 2500.00 USD to 5000.00 USD, per installation. Whereas Oracle pricing is per processor. Oracle does give you a break if it is a multi-core machine but it isn't huge.
If we use the BerkeleyDB Transactional pricing as a model for what MySQL "could be" a quad core machine would cost a MySQL customer 11,600.00-23,200.00 per year. This is a guess because I don't know the calculation for a Xeon quad core, it would be somewhere between .25 and .75 per core. Oracle is not known for making their pricing clear.
Where am I going with all of this? It should be obvious, moving to PostgreSQL with support from a long standing, transparent support and pricing schedule can do nothing but benefit you in the future.
Updated: 09/29/2010 12:19: Current MySQL Pricing1.
"Hello Customer, I am writing as way of introduction. My name is Juliet and I am your MySQL contact at Oracle. It is my understanding that you are the most appropriate person to speak with at your organization regarding MySQL. If you have any MySQL requirements, questions on the products, support, consulting or training we provide, please do not hesitate in contacting me. I'm sure you are aware that Oracle purchased Sun and therefore MySQL last February. We're being told that there will be changes to MYSQL's pricing and possibly pricing model soon and wanted to let you know. We have not had a price increase for over 6 years but there will be an increase in the next price list that will be available soon. We've been expecting the increase for the past couple of months but I'm told it the new price list will be released soon. For those of you using Basic and Silver support we're being told those options will no longer be available. If you wish to continue with Basic or Silver you will need to sign a multi-year agreement and you would be able to keep using Basic or Silver for up to another 3 years. If you are considering purchasing additional licenses for MySQL support subscription, please let me know, because you can save money if you do it before the changes take place, some time in the next month or two. You can also sign multi-year agreements and lock down current prices for up to 3 years. You can receive up to a 30% discount for a 3 yr. commitments pre-pay but annual payments are available as well for multi-year agreements. If you would like to speak to someone about MySQL Cluster, please let me know and I can arrange for an expert to call you within the next week. Please let me know if you have any questions.
That said, it is time to pony up. David Wheeler has put in some serious effort, well thought out, professionally designed and peer reviewed effort on delivering a new architecture for PostgreSQL software and modules. He needs our financial support.
The PostgreSQL Conference provides an opportunity for the Postgres community to come together to share and celebrate the most recent advances to the product. If you are currently a Postgres user, or are considering deploying the world's most advanced open source database within your organization, you can't miss this show. This is a cost effective way to receive training, build your skills, hear from your peers and other end users about their implementations, and network with the community leaders to discuss future product directions. (And have some fun, too!)
Many thanks to our sponsors:
Unlike other communities that are closed where requirements and demands can fester for years in an oblivion of "marketability".
There is however a downside to this aspect of the Open Source community.