see this forum topics: http://drupal.org/node/122580
Seems that the SQL rewriting is badly broken for postgreSQL in some cases.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | db_distinct_field.patch | 796 bytes | wizztick |
see this forum topics: http://drupal.org/node/122580
Seems that the SQL rewriting is badly broken for postgreSQL in some cases.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | db_distinct_field.patch | 796 bytes | wizztick |
Comments
Comment #1
wizztick commentedThe case I encountered where of the form
COUNT(DISTINCT ON (node.nid) node.nid)which should beCOUNT(DISTINCT node.nid).In the forum topic divamys suggest a fix fordb_distinct_field, which works for me. I attached the patch.note: I run postgres 7.4.11. I do not know if this works for all query rewrites or for all versions of postgres.
Comment #2
gregglesI had a similar but different error related to pgsql so I tried this patch, but it didn't help (I didn't expected it too, but thought perhaps it might).
Here is the issue I finally posted: http://drupal.org/node/141362
pwolanin and wizztick - can you describe a simple test case so that I could provide a review of the patch?
I tried this path:
1. Create some content
2. Visit the /tracker page
Expected results:
Errors
Actual Results:
Worked fine
I'm on pgsql8.1.8 if that matters.
Comment #3
pwolanin commentedUnfortunately, I don't have a functioning postgreSQL local/test host- I was only reading about it in the linked forum topic. It's somewhere on my TODO list.
Comment #4
pearcec@drupal.org commentedI am having a similar issue:
http://drupal.org/node/153672
It looks like this might help me. I will examine the patch and test it.
Comment #5
pearcec@drupal.org commentedI tested it and hand to comment out
as well. I don't want it ordering off of the DISTINCT field name. Maybe there is cases were it should be added. But I think it was added because with DISTINCT ON you have to have the field name in the ORDER BY or it won't work. I am going to examine the CVS commits to see if there is anything else to this.
Comment #6
drummhttp://drupal.org/node/181689