Closed (fixed)
Project:
Subscriptions
Version:
4.6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 May 2005 at 21:59 UTC
Updated:
18 Apr 2006 at 16:23 UTC
There are several SQL statements in subscriptions module are not compatible with PostgreSQL. This is a very common mistake often been seen on codes developped on MySQL.
In postgres, while using "GROUP BY" clauses, you must either use an aggregate function or include them in "GROUP BY" list on all the fields been selected. Otherwise postgres does not know which value to display on those not-specified fields. MySQL allows this non-standard query and returns values by its own decision (which I don't know the rule).
Here is a patch against 4.6.0 version of the subscription module which includes all not-aggregated fields in "GROUP BY" clauses.
| Comment | File | Size | Author |
|---|---|---|---|
| subscriptions.module.patch | 1.16 KB | patrickslee |
Comments
Comment #1
dziemecki commentedI can patch, but I don't have a psg environments, so I need a volunteer to test it before I release it. In fact, I need a volunteer for a whole slew of psg stuff. Anyone care to step forward?
Comment #2
hystrix commentedI can test PostgreSQL stuff.
Grabbed the latest CVS
subscriptions.module,v 1.37 2006/03/28
On importing of subscriptions.pgsq
Received the following output:
And then enabling the module (with the above GROUP BY patch in place) produces the following error:
Comment #3
hystrix commentedForgot to mention this was on: Drupal 4.7-beta6 against PostgreSQL 8.0.4
Comment #4
dziemecki commentedGood catch. Unfortunately, I have not way to fix that, without a psg db. Any ideas?
Comment #5
dziemecki commentedComment #6
dziemecki commentedIntegrated and forward-ported patrickslee's patch. Works for me.
Comment #7
dziemecki commentedNo complaints for a week. Closing.