When I use a PostgreSQL as backend it can't interprating some DISTINCTed SQL command:
# warning: pg_query() [function.pg-query]: Query failed: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list in C:\www\drupal-5.16\includes\database.pgsql.inc on line 127.
# user warning: query: SELECT DISTINCT(n.nid) FROM (SELECT DISTINCT ON (nid) * FROM node) n INNER JOIN node_revisions nr ON nr.vid = n.vid INNER JOIN weblinks bw ON bw.vid = nr.vid LEFT JOIN term_node tn ON tn.nid=n.nid WHERE n.status = 1 AND tn.tid IN (23) ORDER BY bw.weight ASC, n.title ASC in C:\www\drupal-5.16\includes\database.pgsql.inc on line 146.
The issue is on line 1858 in weblinks.module:
$query = 'SELECT DISTINCT(n.nid) FROM {node} n ';
which was
$query = 'SELECT n.nid FROM {node} n ';
in the previous version, and worked correctly.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | weblinks_50.patch | 1.81 KB | nancydru |
Comments
Comment #1
nancydruIt would not have worked if you had revisions enabled - you would have ended up with duplicated links.
Please try the attached patch
Comment #2
nancydruNeither of this module's developers have Postgres - we need you to test the changes and let us know if it works.
Comment #3
nancydruThis was committed to 6.x-2.x-dev.
Comment #4
nancydruComment #5
nancydruCommitted to 5.x branch.
Comment #6
nancydru