Another swing at fixing Postgres tests.
Merge pull request #9496 from cachedout/unit-tests

Another swing at fixing Postgres tests.