Compatible with psycopg2.extras.register_json