SQL adaptation guide For PostgreSQL 8.x.y, 9.x.y