Hi,

I see :
query: SELECT DISTINCT u.uid, u.name FROM users u INNER JOIN node n ON u.uid = n.uid WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC LIMIT 10 OFFSET 0 in /www/default/drupal-4.7.3/includes/database.pgsql.inc on line 103.

In the drupal admin error log.

the problem is that the query needs to contain 'n.created' in the SELECT clause... i.e.

SELECT DISTINCT u.uid, u.name, n.created FROM users u INNER JOIN node n ON u.uid = n.uid WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC LIMIT 10 OFFSET 0

See line 210 of the site_map.module file; $Id: site_map.module,v 1.20 2006/07/14 19:46:42 frjo Exp $

thanks
David.

Comments

frjo’s picture

Should all ORDER BYs also be SELECTs for PostgreSQL? There are one or two more places that need to be fixed in that case.

suzanne.aldrich’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev

As far as I can tell, adding the n.created as described above to the SELECT clause does fix the postgresql db error that site_map_blogs() function was causing:

    $result = db_query_range("SELECT DISTINCT u.uid, u.name, n.created 
      FROM {users} u 
      INNER JOIN {node} n ON u.uid = n.uid 
      WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC", 0, 10);
frjo’s picture

Status: Active » Closed (won't fix)