common lethal postgres error
alpapan - October 30, 2009 - 17:27
| Project: | Bibliography Module |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
Description
Hello
After a Drupal 6.14 upgrade, postgres 8.3 and a installation of stable branch of Biblio, I get no results with any biblio query (even though it finds records). I think i tracked the problem to these SQLs:
SELECT DISTINCT(n.nid), bt.name as biblio_type_name FROM (SELECT DISTINCT ON (nid) * FROM rfc_node) n left join rfc_biblio b on n.vid=b.vid inner join rfc_biblio_types bt on b.biblio_type=bt.tid inner join rfc_biblio_contributor as bc1 on n.vid = bc1.vid WHERE (bc1.cid = 6 ) AND (n.type='biblio' ) ORDER BY b.biblio_year DESC, b.biblio_date DESC LIMIT 25 OFFSET 0Causing a:
ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select listPatch removing distinct and fixing this attached
Should have done this first, as I already checked the known Drupal 6.14 AHAH bug, cleared caches, reinstalled biblio etc... i'm such a dummy...
alexie
ps.. i don't know why this distinct is needed (it is ok in the count statement)
| Attachment | Size |
|---|---|
| biblio.pages_.inc_.patch | 532 bytes |

#1
The DISTINCT was there because some other modules like Organic Groups rewrite the Biblio query and can produce duplicate listings. If your not using OG then you should have no problems.
FYI, I think all the PostgreSQL issue should go away with Drupal 7. I'm currently working on the port to D7 so it should be ready when D7 is.
Ron.