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

CommentFileSizeAuthor
#1 user_stats-629896.patch1.2 KBfuerst

Comments

fuerst’s picture

Status: Active » Needs review
StatusFileSize
new1.2 KB

The attached patch fixes this.

fuerst’s picture

Title: Views filter breaks PostgreSQL » Views filter broken with PostgreSQL

Changed title to reflect the problem better

liam mcdermott’s picture

Status: Needs review » Fixed

Patch committed, thank you! I'm always happy to help support PostgreSQL. :)

Status: Fixed » Closed (fixed)
Issue tags: -PostgreSQL

Automatically closed -- issue fixed for 2 weeks with no activity.