Support PostgreSQL version 8.4 (and perhaps older)

Hi,

Here's what I had to do to make our test suite run on PostgreSQL 8.4.  Any comments?