Updated the sql used to run on Postgres versions 9.0.0 or newer.