When accessing my issues with postgres db I get following error:

* warning: pg_query() [function.pg-query]: Query failed: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list in /usr/local/drupal/includes/database.pgsql.inc on line 94.
* user warning: query: SELECT DISTINCT(n.nid) FROM node n INNER JOIN project_issues p ON p.nid = n.nid INNER JOIN node_revisions r ON r.vid = n.vid INNER JOIN users u ON p.assigned = u.uid LEFT JOIN project_comments c ON c.nid = p.nid WHERE n.status = 1 AND (((n.uid = '1') OR (p.assigned = '1') OR (c.uid = '1'))) AND ((p.sid = '1' OR p.sid = '2' OR p.sid = '8' OR p.sid = '13' OR p.sid = '14' OR p.sid = '4')) ORDER BY n.changed DESC LIMIT 20 OFFSET 0 in /usr/local/drupal/includes/database.pgsql.inc on line 113.

This is because n.changed is not also in SELECT. I attached a patch that solves this and it now works. I haven't tested this with mysql.

CommentFileSizeAuthor
issue.inc_.postgres.patch1.12 KBRok Žlender

Comments

dww’s picture

Status: Needs review » Closed (duplicate)

thanks for the patch, but this is duplicate with http://drupal.org/node/109851. let's move this effort back there.