Postgres tests

Tests fail when run under postgres.

I'll try to narrow this down a bit more.