Work with postgres library versions < 8.4 Closes #609