I receiving the following error on the All Points screen and no points are displayed. I am using Drupal 5.5 with PostgreSQL.

 * warning: pg_query() [function.pg-query]: Query failed: ERROR: column "p.tid" must appear in the GROUP BY clause or be used in an aggregate function in /usr/local/apache2/htdocs/drupal/includes/database.pgsql.inc on line 125.
    * user warning: query: SELECT p.uid, u.name, p.points, p.tid, t.name as cat FROM userpoints p INNER JOIN users u USING (uid) LEFT JOIN term_data t ON p.tid = t.tid GROUP BY p.uid, u.name, p.points ORDER BY p.points DESC LIMIT 30 OFFSET 0 in /usr/local/apache2/htdocs/drupal/includes/database.pgsql.inc on line 144.

Comments

jredding’s picture

Sadly postgres support is extremely limited and I'm not sure if the module fully works with PostgresSQL.

I don't have a install of Postgres accessible at the moment so I can't help troubleshoot this. My guess is that this can simply be fixed by placing the p.tid and t.name in the GROUP BY clause but I'm not sure how that would affect the query and results.

kbahey’s picture

Master Yoda says: "them who have PostgreSQL, patches they will submit ..."

WISEOZ’s picture

The fix is to change line 1154 to this:


$sql .= " GROUP BY p.uid, u.name, p.points, p.tid, t.name";

Qui-Gon says: "he who owns module, regression tests ..."

WISEOZ’s picture

Status: Active » Fixed
jredding’s picture

I say "YOU own the module"

This is OSS and you are part of the community thus you OWN the module just as much as the developers listed do. Developers can not be expected to do everything and test on everything.

kbahey’s picture

Title: RROR: column "p.tid" must appear in the GROUP BY » PostgreSQL error: column "p.tid" must appear in the GROUP BY
Status: Fixed » Needs work

WiseOz,

The way things are done is that this is all by participation from the community. The maintainers can only do so much in their spare time.

Start with properly formatted patches that are tested and proven to work. See http://drupal.org/patch

If you don't have time for that, then that is fine, but do state so, AND ask others (maintainers or people who are interested in PostgreSQL with this module) to help out and take it a step further.

Neither me nor jredding use PostgreSQL regularly, so we cannot test that, even if we had the time for it.

WISEOZ’s picture

Those responses are much more useful: "Master Yoda says: "them who have PostgreSQL, patches they will submit ...""

I'm always willing to test any attempts to make something work with PostgreSQL. Unfortunately, I'm not a developer so I can't turn this into a patch. The fix was actually provided by someone more technical than myself that I asked to take a look. Anyone can feel free to turn it into a patch.

jredding’s picture

Assigned: Unassigned » jredding
Status: Needs work » Fixed

Modified the "patch" to modify both queries that were incorrect.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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