Error displayed on node:

* warning: pg_query() [function.pg-query]: Query failed: ERROR: column "dc.fid" must appear in the GROUP BY clause or be used in an aggregate function in /var/www/applications/partnerportal/includes/database.pgsql.inc on line 139.

* user warning: query: SELECT dc.fid, f.filename, COUNT(dc.dcid) AS count, MAX(dc.timestamp) AS last FROM download_count dc JOIN files f ON dc.fid = f.fid WHERE dc.nid = 6 GROUP BY f.filename in /var/www/applications/partnerportal/sites/default/modules/download_count/download_count.module on line 89.

I'm not sure wether this error also occurs on MySQL installations.

Attached patch fixes this issue.

CommentFileSizeAuthor
download-count.sql-error.patch2.13 KBbob.huisman

Comments

WorldFallz’s picture

I don't recall seeing this (and I'm using mysql) but I'll check it and see. I'll also test out the patch and make sure it doesn't make mysql throw a fit. If all goes well it will be in the next commit.

WorldFallz’s picture

Status: Active » Fixed

http://drupal.org/cvs?commit=465464

Thanks!

Seems to test fine and it's a requirement in newer versions of mysql as well.

Status: Fixed » Closed (fixed)

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

-Mania-’s picture

While the module works otherwise, I'm getting similar errors on the My Download Counts and Download Count pages:

My Download Counts

* warning: pg_query() [function.pg-query]: Query failed: ERROR: column "dc.dcid" must appear in the GROUP BY clause or be used in an aggregate function in /var/vhost/drupal/drupal-6.19/includes/database.pgsql.inc on line 139.

* user warning: query: SELECT COUNT(dc.dcid) AS count, dc.dcid, f.filename, MAX(dc.timestamp) AS last, dc.nid, f.filepath, f.fid, n.title FROM download_count dc JOIN files f ON dc.fid = f.fid JOIN node n ON dc.nid = n.nid WHERE dc.uid = 1 GROUP BY dc.nid, f.filename ORDER BY count DESC in /home/staff/username/vhost/www.example.com/modules/download_count/includes/download_count.pages.inc on line 55.

Download Count

* warning: pg_query() [function.pg-query]: Query failed: ERROR: column "dc.dcid" must appear in the GROUP BY clause or be used in an aggregate function in /var/vhost/drupal/drupal-6.19/includes/database.pgsql.inc on line 139.

* user warning: query: SELECT COUNT(dc.dcid) AS count, dc.dcid, f.filename, MAX(dc.timestamp) AS last, dc.nid, f.filepath, f.fid, n.title FROM download_count dc JOIN files f ON dc.fid = f.fid JOIN node n ON dc.nid = n.nid GROUP BY dc.nid, f.filename ORDER BY count DESC in /home/staff/username/vhost/www.example.com/modules/download_count/includes/download_count.pages.inc on line 42.