Some SQL queries were not compatible with PostgreSQL. I've made them to work correctly with (and only with) PostgreSQL.

Sources: https://github.com/david-barbion/visitor-maps