Datastore tests aren't respecting the legacy_mode flag

This breaks CKAN on Postgres 8.4.