Support pre and post 9.2 versions of postgres