Fixing each method call and pg gem dependency version update

The "each" method didn't worked the way it supposed to work. It run untill index + 1.
The test "test_database.rb:91:in `test_04_prepare'" is broken, it fails with "assert_equal( dbh.last_statement.object_id, sth.object_id )"
If you advised me what should be the tests problem i would happily try to fix it.