bug fix: rand to replace random for postgres