956266 - Fixing bad content views SQL statement

Fixing SQL statement in content views that works in PostgreSQL 9.1+ but not in
PostgreSQL 9.0 and Postgres 8.x.
Merge pull request #2112 from daviddavis/956266

956266 - Fixing content views SQL statement