support PostgreSQL down to 9.0; JSON is optional