raulm
committed
on 15 Sep 07
doing the case logic outside where_clause as this case syntax is only for postgresql