Adds version support for postgresql. Closes #369