Fixes #6549 : Errors in postgres when you upgrade from 2.2.

Given the differences in the representation of boolean values in the our databases, we need to make sure that we use the methods DbConnectionFactory.getDBTrue() and DbConnectionFactory.getDBFalse() in SQL queries all the time.