PostgreSQL has stronger SQL statdards implementation so query from node_revision_delete_candidates() throws an exeption:

PDOException: SQLSTATE[42703]: Undefined column: 7 ERROR: column "total" does not exist LINE 6: HAVING total > '10' ^: SELECT n.nid, count(*) as total FROM {node} n INNER JOIN {node_revision} r ON r.nid = n.nid WHERE n.type = :content_type GROUP BY r.nid HAVING total > :max_revisions ORDER BY total DESC; Array ( [:content_type] => article [:max_revisions] => 10 ) in node_revision_delete_candidates() (line 244 of node_revision_delete/node_revision_delete.module).

CommentFileSizeAuthor
#1 postgresql_pdoexception-2333555-1.patch918 byteskalabro

Comments

kalabro’s picture

Status: Active » Needs review
StatusFileSize
new918 bytes

Patch attached. Tested on MySQL 5.5.37 and PostgreSQL 9.1.13

smscotten’s picture

Worked like magic for me.

Tested on PostgreSQL 9.1.14

vbouchet’s picture

Status: Needs review » Reviewed & tested by the community

I tested the patch both on MySQL and PostgreSQL and it works properly.

juampynr’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed. Thanks!

  • juampy committed 74acb4e on 7.x-3.x authored by kalabro
    Issue #2333555 by kalabro, smscotten and vbouchet: PostgreSQL...

Status: Fixed » Closed (fixed)

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

dqd’s picture

Issue tags: -PostgreSQL

Please commit this patch also to 2.x branch or report about if already done, since it has been reported here that it works on 2.6 too and this branch is newer and has been updated lately. 3.x has been not updated for years.

adriancid’s picture

Version: 7.x-3.x-dev » 7.x-2.x-dev
Status: Closed (fixed) » Fixed
adriancid’s picture

Well I don't know why the commit is not listed here, but you can see that is made:

http://cgit.drupalcode.org/node_revision_delete/commit/?id=61d2bf3cc22f5...

Please review in the last dev version to see if the code is working as expected.

Thanks to all.

Status: Fixed » Closed (fixed)

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

adriancid’s picture