The User Stats filter for Views uses Views query->add_having() method to add the expression alias users_is_online to the HAVING clause. This works in MySQL but not in PostgreSQL. In PostgreSQL you must use existing field names or an expression. (Did not find documentation for this though at http://www.postgresql.org/docs/current/interactive/queries-table-express...).
This does not work in PostgreSQL:
HAVING users_is_online = 1
This does work well in PostgreSQL:
HAVING IF((1257954039 - MAX(sessions.timestamp)) < 900, 1, 0) = 1
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | user_stats-629896.patch | 1.2 KB | fuerst |
Comments
Comment #1
fuerst commentedThe attached patch fixes this.
Comment #2
fuerst commentedChanged title to reflect the problem better
Comment #3
liam mcdermott commentedPatch committed, thank you! I'm always happy to help support PostgreSQL. :)