I receive the following error on the Adjustments page within a Product node.

    * warning: pg_query() [function.pg-query]: Query failed: ERROR: column "pa.nid" must appear in the GROUP BY clause or be used in an aggregate function in /usr/local/apache2/htdocs/includes/database.pgsql.inc on line 126.
    * user warning: query: SELECT pa.*, a.*, COUNT(po.oid) FROM uc_product_attributes AS pa LEFT JOIN uc_attributes AS a ON pa.aid = a.aid LEFT JOIN uc_attribute_options AS ao ON a.aid = ao.aid LEFT JOIN uc_product_options AS po ON ao.oid = po.oid AND po.nid = 719 WHERE pa.nid = 719 GROUP BY ao.aid HAVING count(po.oid) > 0 in /usr/local/apache2/htdocs/includes/database.pgsql.inc on line 145.

I am using Drupal 5.5 with PostgreSQL.

CommentFileSizeAuthor
#6 uc_attribute.adjustment_form.patch1.26 KBcha0s

Comments

rszrama’s picture

Title: Error On Product->Adjustments » Postgres Error On Product->Adjustments
rszrama’s picture

Issue tags: +PostgreSQL
cha0s’s picture

Assigned: Unassigned » cha0s
Status: Active » Postponed (maintainer needs more info)

I created a product with an attribute, added 3 options and visited the adjustments page... I didn't receive a pgsql warning. Could someone else confirm whether this is still an issue?

guodskrap’s picture

I am running Drupal 6 and am receiving the same error when editing a product and clicking on the Adjustments tab.

* warning: pg_query() [function.pg-query]: Query failed: ERROR: column "pa.nid" must appear in the GROUP BY clause or be used in an aggregate function in /srv/sites/siv3/includes/database.pgsql.inc on line 139.
* user warning: query: SELECT pa.nid, pa.aid, pa.ordering, a.name, a.ordering, ao.aid, COUNT(po.oid) FROM uc_product_attributes AS pa LEFT JOIN uc_attributes AS a ON pa.aid = a.aid LEFT JOIN uc_attribute_options AS ao ON a.aid = ao.aid LEFT JOIN uc_product_options AS po ON ao.oid = po.oid AND po.nid = 42 WHERE pa.nid = 42 GROUP BY ao.aid, pa.aid, a.name, pa.ordering, a.ordering HAVING count(po.oid) > 0 ORDER BY pa.ordering, a.ordering in /srv/sites/siv3/sites/all/modules/ubercart/uc_attribute/uc_attribute.admin.inc on line 904.

rszrama’s picture

Version: 5.x-1.0-rc2 » 6.x-2.0-beta3
cha0s’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.26 KB

Ah, I see. It appears the pa.nid field was removed from the query in 1.x, so I didn't see the error. Thanks for bumping this up though, cause it's present in 2.x. Patch follows =)

guodskrap’s picture

Now THAT's service!

rszrama’s picture

Status: Needs review » Fixed

Gracias. Committed.

Status: Fixed » Closed (fixed)

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

interestingaftermath’s picture

Has this issue somehow resurfaces? I am running the latest version of ubercart but still getting this same error. I tried to patch but (as I suspected) it's for an other version, or so it seems.

Help?

interestingaftermath’s picture

Status: Closed (fixed) » Active

I am running Drupal 6.15 and Ubercart 6.x-2.2 and still seeing this issue when clicking Adjustments:

    * warning: pg_query() [function.pg-query]: Query failed: ERROR: column "pa.display" must appear in the GROUP BY clause or be used in an aggregate function in /var/www/includes/database.pgsql.inc on line 139.
    * user warning: query: SELECT pa.nid, pa.aid, pa.ordering, pa.display, a.name, a.ordering, ao.aid, COUNT(po.oid) FROM uc_product_attributes AS pa LEFT JOIN uc_attributes AS a ON pa.aid = a.aid LEFT JOIN uc_attribute_options AS ao ON a.aid = ao.aid LEFT JOIN uc_product_options AS po ON ao.oid = po.oid AND po.nid = 7297 WHERE pa.nid = 7297 AND pa.display <> 3 GROUP BY ao.aid, pa.aid, a.name, pa.ordering, a.ordering, pa.nid HAVING count(po.oid) > 0 ORDER BY pa.ordering, a.ordering in /var/www/sites/all/modules/contrib/ubercart/uc_attribute/uc_attribute.admin.inc on line 1045.
tr’s picture

Status: Active » Closed (fixed)

Again, this is fixed in -dev.