Fix a SQL syntax not compatible with PostgreSQL.