Fix wrong definition of id in all tables for postgreSQL

- Fix query unsupported by postgreSQL in UsersHelper.php because the IF() isn't supported