Conceptually speaking, there is essentially nothing that DB2 has that PostgreSQL doesn't. By "conceptually" I mean the logical capabilities of a relational database. They will both have transactions, foreign keys, views, triggers, stored procedures, etc...
Now, the differences:
1. Pro-DB2
I'm fairly sure that the main areas where DB2 will differ from PostgreSQL are what the business usually refers to as "value added" features, such as an integrated GUI administration system, (possibly) a smoother install routine, and integrated add-on features such as replication, failover, clustering, etc... Also, of course, there is "official" corporate support for the software.
2. You Be the Judge
DB2 also of course (as most commercial DBMS's) now boasts a whole set of bundled tools for such stuff as XML, SOAP, development libraries, OLAP, etc... These things shouldn't rightfully be called part of the database, because they are
application tools, rather than core database features. And of course special support for "complex" datatypes such as multimedia data, etc... I personally think most of these attempts are somewhat counter-productive, as they take the focus off of what should be the main job of the database: providing the proper internal constraints for managing data and providing a logically universal method to query and manipulate the data (the query language). Everything else belongs in application space. It has become a fad lately to bundle everything but the kitchen sink in with a database, when those tools can quite easily be applied separately, as the developer wishes. An example of the most ridiculous side of this is how all the vendors are now saying their databases are "Web-ready", as if it takes a special kind of database to handle data for the internet. (lol) Data is data! These are just marketing techniques designed to get business leaders to try and make the technical decisions they probably should leave to their engineers and developers. See my favorite database website for more opinions in this area:
3. Pro-PostgreSQL
ON the contrary from section 2, PostgreSQL supports all of the standard SQL-relational features of the "big business" databases, in a relatively clean and straightforward fashion. The primary download for PostgreSQL is around 9-10 MB, while any other big SQL database usually takes more than 100 MB to download just the base files. Yet it provides all the same relational database constraints. Go figure.
PostgreSQL also does a few extra things that many other databases don't, such as:
1. object-relational inheritance in table attributes. I don't think any other major database supports this feature. It provides for some very interesting programming possibilities that would take far too long to explain here.
2. Spatial (geometric) datatypes, as well as special operators and algorithms for doing queries based on spatial relationships. I believe DB2 has some of these features also, but I don't know if it is as complete as PostgreSQL's
3. User-defined datatypes and operators. With PostgreSQL you can define your own datatype that plays by your own rules. Thus, you can handle any type of "complex" data however you want. In fact, there is a company that has extended postgreSQL's spatial datatypes to include a full GIS package (
4. PostgreSQL is making serious advances on enterprise features such as replication, high availability, clustering, failover, etc... Spend some time at
for more info.
5. The source code. Commercial vendors don't give you the source code to your database. With PostgreSQL, if there is really something you aren't sure about, you can (hire someone to) look at the source code to make sure. You can even re-write parts of it for your needs.
6. The source code is free, and not just in the GPL sense. Software that is distributed under the GPL prevents you from re-releasing any project that includes that code, without releasing the code itself, including any of your proprietary code that is included. PostgreSQL is released under the BSD license, which allows you to embed the code in your project without forcing you to release your source along with it. All you need to do is give the PostgreSQL team credit for the database. This is great for any business who might need to include an embedded database engine in a complex project they are releasing.
7. Commercial support? Go to
click on "Support". Enough said.
As you can tell, I really like PostgreSQL. I have spent my time with MySQL, and while it makes the easy things easier, it makes the hard things harder. PostgreSQL makes the hard things easier, and in some cases makes the impossible... possible. I'm sure you can't go wrong with DB2, but you also can't go wrong with PostgreSQL, and while it may require a little more effort up front, in the end you won't regret it. -------------------------------------------
"Now, this might cause some discomfort..."
(