- Ported some SQL strings from MS SQL Server to PostgreSQL;