I found this line causing a problem when trying to use PostgreSQL in subscription_content.admin.inc. Basically, pgSQL doesn't like IF, would rather use CASE, in 7.x-1.1 it's line 145.

    $query->addExpression('IF(s.send_updates = 0, n.created, n.changed)', 'latest_activity');

I replaced it with this and it seems to work better:

    $query->addExpression('CASE WHEN s.send_updates = 0 THEN n.created
                                ELSE n.changed END', 'latest_activity');

This would be helpful to make this latest version PGSQL compatible.

Comments

salvis’s picture

Do we have evidence that CASE works with MySQL, SQLite, etc., too?

dandaman’s picture

Hmmm, I have not tested that. I may try to do so if I have time, but I guess maybe we should do it just for Postgres?

salvis’s picture

We do separate code paths if pgsql requires a less efficient implementation. But in general, we try to avoid this, because pgsql does not receive adequate testing.

salvis’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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