Using postgresql and the who's online block throws this error:

    * warning: pg_query() [function.pg-query]: Query failed: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list in /var/www/includes/database.pgsql.inc on line 125.
    * user warning: query: SELECT DISTINCT u.uid, u.name FROM users u INNER JOIN sessions s ON u.uid = s.uid WHERE s.timestamp >= 1178287457 AND s.uid > 0 ORDER BY s.timestamp DESC in /var/www/includes/database.pgsql.inc on line 144.

The code appeared when I enabled the "who's online" block so I investigated that and found that it orders by the s.timestamp but does not include that in the select list which apparently is a problem for pgsql.

Attached patch includes the column in the select list. This is a minor performance hit for MySQL because it returns unnecessary data, but I believe it's an acceptable performance hit to get the query working on PGSQL.

I tested a default ubuntu: pgsql8.1.8 and MySQL 5.0.

CommentFileSizeAuthor
onlineblock_pgsql_compliance.patch1.11 KBgreggles

Comments

greggles’s picture

Status: Needs review » Closed (duplicate)

http://drupal.org/node/148974

"duplicate" of a later bug... :/