Tuesday, August 7, 2007

EnterpriseDB and the Professional Grade

I was naturally confused when I read about EnterpriseDB announcing the First-Ever Professional-Grade PostgreSQL Distribution for Linux. I would have thought that at least Great Bridge, Red Hat, and Pervasive would have prior claim to that title, and there are surely others who might fit this category but don't make so much noise about it.

So that needed to be cleared up. I went to download their "EnterpriseDB Postgres" package, versioned 824-linux-x32-b1. (Is that beta 1?) This unpacks to a setup_x86.bin file. I recalled my bumpy experience with the installer of EnterpriseDB proper, but this one seems to work quite a bit better. It's the same Java-type installer, for what it's worth, but this one actually ran to the end without error at the first attempt. Somehow it even installed all the software with the proper library dependencies for my Debian system, including the dreaded libssl issue, so that was really a relief.

The installation contains PostgreSQL, Slony-I, PostGIS, pgAdmin, phpPgAdmin, JDBC and ODBC drivers, Apache, and PHP, each in current versions. The default installation goes to /opt/edb-postgres/8.2/, but you can change that. The entire installation is owned by the postgres user, so no points for security.

The installation layout looks like this:

$ ls -l /opt/edb-postgres/8.2/8.2.4
total 56
drwxrwxr-x 15 postgres root 4096 2007-08-08 11:13 apache/
drwxrwxr-x 2 postgres root 4096 2007-08-08 11:14 bin/
drwxrwxr-x 3 postgres root 4096 2007-08-08 11:13 doc/
-rwxrwxr-x 1 postgres root 369 2007-08-08 11:13 env.55434*
drwxrwxr-x 2 postgres root 4096 2007-08-08 11:13 etc/
drwxrwxr-x 6 postgres root 4096 2007-08-08 11:13 include/
drwxrwxr-x 2 postgres root 4096 2007-08-08 11:14 install_logs/
drwxrwxr-x 2 postgres root 4096 2007-08-08 11:13 jdbc/
drwxrwxr-x 3 postgres root 4096 2007-08-08 11:14 lib/
drwxrwxr-x 7 postgres root 4096 2007-08-08 11:13 pgadmin3/
drwxrwxr-x 6 postgres root 4096 2007-08-08 11:13 php/
-rwxrwxr-x 1 postgres root 214 2007-08-08 11:13 postgres.env*
drwxrwxr-x 5 postgres root 4096 2007-08-08 11:13 share/
drwxrwxr-x 6 postgres root 4096 2007-08-08 11:13 utils/


This was clearly designed by a Windows engineer who never heard of a Linux file system hierarchy standard.

How is this actually works out is that there is a bin/psql which is a shell script that sets PATH and LD_LIBRARY_PATH and then calls bin/psql.bin which is the actual binary. Unfortunately, this shell wrapper neglects to set the right TCP port (which I configured in the installer as 55434, the default offer was 5433), so just calling psql without options doesn't connect. I'm not sure whether it is intentional that way.

But all the programs seem to generally work. Even pgAdmin has no problems with libraries or whatnot. phpPgAdmin is available at http://localhost:8080/. The default database contains a few sample tables that I seem to recall to have seen in the EnterpriseDB installer as well. All in all it's a normal PostgreSQL installation with a crazy installation layout. There is also an init script based on the one you find in the PostgreSQL source code distribution. A vacuum cron job or autovacuum is not configured, and the postgresql.conf file isn't tuned.

Now what makes this "professional grade"? The installation uses insecure permissions, nobody knows how to upgrade these things, nobody knows whether there will be security updates for the integrated Apache and PHP components, there is no integration into log rotation, log checking, or other system services, the setup isn't tuned or configured, no vacuum, nobody has access to the source code of the installer, so you don't know what's in there and can't fix it yourself.

It remains to be explained why this is any more useful than whatever your local apt or yum installs.