For some weird reason its running the postgres query. "coalesce" does not exists in Oracle. Try to look the cause why its running the PG query and not the Oracle one. Good Luck.