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
Comment #1
jredding commentedSadly 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.
Comment #2
kbahey commentedMaster Yoda says: "them who have PostgreSQL, patches they will submit ..."
Comment #3
WISEOZ commentedThe 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 ..."
Comment #4
WISEOZ commentedComment #5
jredding commentedI 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.
Comment #6
kbahey commentedWiseOz,
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.
Comment #7
WISEOZ commentedThose 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.
Comment #8
jredding commentedModified the "patch" to modify both queries that were incorrect.
Comment #9
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.