make it possible to not use json with Postgres

using json field in postgres causes issues with aggregates and distinct because of missing equality checkers for the json columns.

there should be a way to opt-out of the postgres json column optimization