Change SQL to work with the PostgreSQL version of GMSchema