Fixed multiple issues with PostgreSQL 9.2+ queries.

The queries were still previously querying against the "query" column
for state, however this has all moved into the new "state" column.
Merge pull request #24 from disqus/fix-post92-queries

Fixed multiple issues with PostgreSQL 9.2+ queries.