Bringing back some old code removed for hhvm, we do need it
Fixing postgres tests
Merge pull request #3084 from cakephp/3.0-postgres-fixes

3.0 postgres fixes