Added postgres 9 support