Fix tests on PostgreSQL