Issue 977

Fix for #977 inserting false values into PostgreSQL using haveInDatabase().

You'll have to manually change the DbTest module's unit test to use postgres in order to verify the change works on postgres.