[BUGFIX] Avoid SQL error for scheduler task on PostgreSQL